Android Question Error using Wait on FTP Downloading

Patrick Fahey

Member
Licensed User
I am trying to use the Wait for Feature using the example in the tutorial as a guide
I am trying to download a file from an ftp site and have the system wait until the file is downloaded
here is my Code
*********************************************************************************
Starter.ftp.Initialize("ftp",Starter.sys_ftpsite,21,Starter.sys_ftpun,Starter.sys_ftppw)

Log("downloadfile Files")

Dim sf1 As Object = Starter.ftp.DownloadFile("/Sutherlin/download/live/routefile2.csv",False,File.dirrootexternal,"returncust2.txt")

Wait For (sf1) ftp_DownloadCompleted (ServerPath As String, Success As Boolean)

If Success Then

Log("Customer file was download successfully")

Else

Log("Error download file")

End If
*********************************************************************************
The Error I receive when compile and running in the debug mode is

B4A Version: 8.30
Parsing code. (0.05s)
Compiling code. Error
Error compiling program.
Error description: Static code modules cannot handle events.
Error occurred on line: 28
Wait For (sf1) ftp_DownloadCompleted (ServerPath As String, Success As Boolean)
Word: wait for
**********************************************************************************
 
Last edited:
Top