How can I make the below code stop at the msgbox and display when it succeeds and when it fails. It does not stop even with the msgbox in the code.
B4X:
'DOWNLOAD COMPLETED
Sub FTP_DownloadCompleted (ServerPath As String, Success As Boolean)
Log(ServerPath & ", Success=" & Success)
If Success = False Then
Msgbox(LastException.Message & ". No Files were downloaded to device.".ToUpperCase,"")
'Log(LastException.Message)
Return
Else
Msgbox("Files downloaded successfully to device.","")
End If
End Sub
Since the DownloadCompleted is called after each file, it does not look like I am going to be able to achieve what I want, which is one final message box after all the downloads succeed and one message box after the failures, even with mc73 code below. The msgbox does not fire at all:
B4X:
Dim ProcessFinishedFlag(6)As Boolean
Dim DownloadCounter ,TotalDownloads As Int :DownloadCounter=0
B4X:
'DOWNLOAD COMPLETED
Sub FTP_DownloadCompleted (ServerPath As String, Success As Boolean)
ProcessFinishedFlag(DownloadCounter)=Success
DownloadCounter=DownloadCounter+1
Dim k As Int
If DownloadCounter=TotalDownloads Then
Dim s As String :s=""
For k=0 To TotalDownloads-1
s=s & "Download #: " & (k+1) & " "
If ProcessFinishedFlag(k)=False Then
s=s & " Failed, "
Else
s=s & " Succeeded, "
End If
Next
Msgbox(s,"Final results")
End If
End Sub
@mc73: Do you have any more creative ideas because all I want is this: One final message box after all the downloads succeed and one message box after the failures.
@mc73: Do you have any more creative ideas because all I want is this: One final message box after all the downloads succeed and one message box after the failures.