OnTaskRun Event  
 

The OnTaskRun event occurs while a background task is active.

Syntax

Sub object_OnTaskRun ( [Index As Integer], ByVal TaskId As Variant, ByVal TimeElapsed As Variant, ByVal Completed As Variant )

Remarks

The OnTaskRun event is generated periodically during a file transfer while the background task is active. 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.
Completed
An integer value that specifies an estimated percentage of completion.

The rate and number of times that this event will be generated depends on the task being performed. This event is generally analogous to the OnProgress event for file transfers that are performed in the current working thread, however the OnTaskRun event will occur for each individual background task that is active. The TimeElapsed parameter specifies the amount of time that the task has been active, and the Completed parameter specifies an estimated percentage of completion. This can be used to update the user interface if needed, however it is the application's responsibility to determine which UI component (such as a ProgressBar control) is associated with a particular task.

See Also

AsyncGetFile Method, AsyncPutFile Method, OnTaskBegin Event, OnTaskEnd Event