If I make repeated async calls to a sub, each time waiting for the completeion, can I be sure the order of completion is the same as the calls made.
In this example, can I trust that upon completion, strFile is the same as it was when the call was made to ftp.Download, or do I need to interrogate ServerPath to reassign what strFile is upon completion.
I understand if I did not use Wait For and relied on Sub ftp_DownloadCompleted() then it certainly could arrive at Sub ftp_DownloadCompleted() out of order.
eg:
for i = 0 to 5
strFile = strArray(i)
sf = ftp.DownloadFile(strFile, True, File.DirInternal, strFile)
Wait For (sf) ftp_DownloadCompleted (ServerPath As String, Success As Boolean)
If Success Then
' can I gurantee strFile here is same as was set 4 lines above
In this example, can I trust that upon completion, strFile is the same as it was when the call was made to ftp.Download, or do I need to interrogate ServerPath to reassign what strFile is upon completion.
I understand if I did not use Wait For and relied on Sub ftp_DownloadCompleted() then it certainly could arrive at Sub ftp_DownloadCompleted() out of order.