Waiting for a Task to Complete (Wait)

Use the Wait method to tell the Transfer Engine to hold all other tasks until a specific asynchronous task is completed. Then continue with the rest of the script.

Syntax

String Object.Wait (long taskIndex, long timeout)

Parameters

taskIndex

This is the task index in the asynchronous tasks array. The default = -1 (which is current task). It can range from 0 to the total number of tasks minus one.

timeout

Determines how long (in milliseconds) to wait for a finished, cancelled, or error status before continuing with the script.

 

Return Value

"CANCELLED"

Transfer was stopped by the user

"FINISHED"

Transfer was successfully finished

"ERROR"

There were errors during the transfer

"SKIPPED"

The transfer was skipped (file overwrite rules)

Example

Set MySite = CreateObject("CuteFTPPro.TEConnection")

'Initialize all necessary fields for MySite : host name, user, password, etc.

MySite.TransferURLAsync "ftp://ftp.cuteftp.com/pub/cuteftp"

strResult = MySite.Wait

If (strResult = "ERROR") then

MsgBox "warning! An error has occurred!"

End if

Configuration Notes