OnTaskEnd Event  
 

The OnTaskEnd event occurs when a background task completes.

Syntax

Sub object_OnTaskEnd ( [Index As Integer], ByVal TaskId As Variant, ByVal TimeElapsed As Variant, ByVal ErrorCode As Variant )

Remarks

The OnTaskEnd event is generated when a file transfer completes and the background task has terminated. The arguments to this event are:

TaskId
An integer value that uniquely identifies the background task.
TimeElapsed
An integer value that specifies the amount of elapsed time in milliseconds.
ErrorCode
An integer value that specifies the last error code for the task.

This event can be used in conjunction with the OnTaskBegin event to monitor one or more background tasks that are created to perform asynchronous file transfers. The TimeElapsed parameter will specify the number of milliseconds that the background task was active. The ErrorCode parameter specifies the last error code associated with the background task. If this value is zero, that indicates that the task completed successfully. A non-zero value indicates that the task failed and the error code value identifies why the task failed.

See Also

AsyncGetFile Method, AsyncPutFile Method, OnTaskBegin Event, OnTaskRun Event