Android Question Correct use of Wait

carloskds

New Member
Hi, this is my code

mycode:
        Dim tmp As Object = Ftp.UploadFile( Main.AppDataDir, "abonos.csv", True, NameFile )
        Wait For (tmp) FTP_UploadCompleted (ServerPath As String, Success As Boolean)
        If Success Then
            Awake.ReleaseKeepAlive
            ProgressDialogHide
            ChangeStateBtn( True )
            MsgboxAsync( "Se respaldo la información en servidor FTP", "Respaldo de cobro" )
        Else
            Awake.ReleaseKeepAlive
            ProgressDialogHide
            ChangeStateBtn( True )
            ToastMessageShow( "Falla en envio de datos al FTP!", True )
        End If

is correct?
or is better
mycode2:
[CODE lang="b4x" title="mycode"]        
        Dim tmp As Object = Ftp.UploadFile( Main.AppDataDir, "abonos.csv", True, NameFile )
        Wait For (tmp) FTP_UploadCompleted (ServerPath As String, Success As Boolean)
        If Success Then
            MsgboxAsync( "Se respaldo la información en servidor FTP", "Respaldo de cobro" )
        Else
            ToastMessageShow( "Falla en envio de datos al FTP!", True )
        End If
        Awake.ReleaseKeepAlive
        ProgressDialogHide
        ChangeStateBtn( True )
 
Top