Encapsulates the AutoMate™ action in the “Flow Control” group, “Start Another Task.” The method causes AutoMate™ to start another task.
Declaration
function StartTask (varTaskName As Variant,
intWaitUntilDone As Integer,
intFailThis As Integer) As Integer
Parameters
varTaskName
The name of the task to be started. The task must be in the currently loaded task list.
intWaitUntilDone
Specifies whether this script should wait for the new task to complete before continuing. Set to “1” to wait for the new task to finish or “0” to continue with this task after the new one starts.
intFailThis
Specifies whether this task should fail as a result of the failure of varTaskName. If intFailThis is set to “1”, the method returns “1” if varTaskName fails; otherwise, the method returns “0.” This parameter is ignored unless intWaitUntilDone is set to “1.”
Description
Use the StartTask method to start executing another task alongside the currently running task. StartTask can wait until the new task is finished before continuing by setting intWaitUntilDone to “1.”
StartTask returns “0” if the task started successfully, unless intWaitUntilDone is set to “1” and intFailThis is set to “1.” In this case, StartTask returns “0” if the new task started and ended successfully, or it returns “1” if the new task either did not start or failed.