'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
@Erel: When I intentionally disconnetc the internet or intentionally store a wrong password to test it, the msgbox does not stop when Success=False.I'm unable to reproduce it.
@mc73: How would I use the msgbox2 when all I want is a message display, not a prompt to answer a question? You got me on this one.what if you try using msgbox2? still the same?
'DOWNLOAD COMPLETED
Sub FTP_DownloadCompleted (ServerPath As String, Success As Boolean)
Log(ServerPath & ", Success=" & Success)
If Msgbox2("No connection","no internet",False,"","",Null)= DialogResponse.POSITIVE Then
Msgbox(LastException.Message & ". No Files were downloaded to device.".ToUpperCase,"")
End If
End Sub
'DOWNLOAD COMPLETED
Sub FTP_DownloadCompleted (ServerPath As String, Success As Boolean)
Log(ServerPath & ", Success=" & Success)
select Success
case false
dim rt as int
rt=Msgbox2(LastException.Message & ". No Files were downloaded to device.","nointernet","OK","","",Null)
If rt= DialogResponse.POSITIVE Then
return
End If
case true
dim rt as int
rt=Msgbox2("successful download,"allOK","OK","","",Null)
If rt= DialogResponse.POSITIVE Then
return
End If
end select
End Sub
Msgbox(LastException.Message & ". No Files were downloaded to device.".ToUpperCase,"")
@mc73 and Erel: Thank you for your code. Unfortunately, it behaved exactly the same way as my first post code. What I am seeking the answer to is this:
When I intentionally disconnet the internet or intentionally store a wrong password to test it, I would like the msgbox to stop when Success=False. To my chagrin, it does not stop to say that it failed as I wanted it to display in the first post.
It does not stop at this below line:
B4X:Msgbox(LastException.Message & ". No Files were downloaded to device.".ToUpperCase,"")
@Erel: Thank you so much for addressing this issue
1. SUCCESS=False: How good is log() to a user using the release version when he/she cannot see a msgbox to explain the problem. I am not as much concerned about the debug mode.
2. SUCCESS=True. How can you have only ONE msgbox when download success=true only after all 6 files have been successfully downloaded.
These are only the 2 issues I have not been able to accomplish.
Thanks
dim processFinishedFlag()as boolean, uploadCounter as int,totalUploads as int
uploadCounter=0
processFinishedFlag(uploadCounter)=success:uploadCounter=uploadCounter+1
if uploadCounter=totalUploads then
dim s as string:s="":for k=0 to totalUploads-1
s=s & "upload #" & (k+1) & " "
if processFinishedFlag(k)=false then s=s & "failed, " else s=s & "succeeded, "
next
msgbox(s,"something like this")
end if
I assume you are referring to theInside the FTP sub
Sub FTP_DownloadCompleted (ServerPath As String, Success As Boolean)
OK mc73. I will try that and report back. I am actually concerned about the DOWNLOAD part. I only upload 1 file, but download 6 files to the device. I hope I can still apply your code to the download.
I assume you are referring to theThank you again for persevering.B4X:Sub FTP_DownloadCompleted (ServerPath As String, Success As Boolean)
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?