# # upload_retry.ftp # upload a set of files to the FTP server # Retry to connect to the server if connection failed :connect result_open_host=OPENHOST("ftp.myhost.com","myuser","123456") IF(NOT(ISEQUAL(result_open_host,"OK"))) PRINT("Cannot connect! Trying again.") # Wait 10 seconds and try again SLEEP(10) GOTO connect END IF # upload the files PUTFILE("sales.xls") PUTFILE("backup.zip") PUTFILE("notes.txt") PUTFILE("1.jpg") CLOSEHOST()