Syntax
Pauses the current code until every listed task has ended.
AWAITALL <handle>[, <handle>…]Parts
| <handle> | A task handle. List as many as needed, separated by commas. |
|---|
Good to know
- If a task fails,
AWAITALLraises that error as soon as it happens. It does not wait for the other tasks, which keep running. - A cancelled task counts as ended and raises nothing.
- One handle is accepted, and then it behaves like
AWAITTASK. - Refused inside a
FUNCTION, likeAWAITTASK. It is a statement: it gives no value back. Read each result withTaskResult().
Example
a AS TASKHANDLEb AS TASKHANDLESTARTTASK a, WoodSTARTTASK b, StoneAWAITALL a, bConsole("total " + Str(TaskResult(a) + TaskResult(b))) ' total 12ENDWood: Wait(0.2)RETURN 5Stone: Wait(0.4)RETURN 7In the manual : The game loop and tasks