Can cause some issues a "resumable sub" that can return value without wait for or sleep?
example:
If i don't use ftp the operation is made without async event.
Should i put a sleep(0) before of file.copy or can i do it without async function?
(I know the existence of file.copyAsync, this is only an example)
example:
B4X:
Sub MySub(Destination As String, UseFTP As Boolean) As ResumableSub
Dim success As Boolean = False
If UseFTP Then
Dim ftp As FTP
ftp.Initialize("FTP", "xxx.xxx.xxx.xxx", 21, "user", "password")
wait for (ftp.UploadFile("dirSource", "fileSource", True, Destination&"/fileSource")) FTP_UploadCompleted (ServerPath As String, succ As Boolean)
success = succ
Else
File.Copy("dirSource", "fileSource", Destination, "fileTarget")
If File.Exists("dirSource", "fileSource") Then success = True
End If
Return success
End Sub
If i don't use ftp the operation is made without async event.
Should i put a sleep(0) before of file.copy or can i do it without async function?
(I know the existence of file.copyAsync, this is only an example)