Sintassi
Mette in pausa il codice corrente finché il primo dei task elencati non termina, fallisce o viene annullato.
AWAITANY <handle>[, <handle>…]Le parti
| <handle> | Un handle di task. Elencane quanti servono, separati da virgole. |
|---|
Da sapere
AWAITANYnon solleva mai l'errore di un task fallito. Controlla poiTaskDone()eTaskFailed()per sapere quale task è terminato e come.- Non dice quale task è terminato: non restituisce alcun valore.
- Gli altri task continuano a girare. Ferma quelli che non ti servono più con
CANCELTASK. - Rifiutato dentro una
FUNCTION, comeAWAITTASK.
Esempio
BASIC
slow AS TASKHANDLEfast AS TASKHANDLESTARTTASK slow, SlowSTARTTASK fast, FastAWAITANY slow, fastIF TaskDone(fast) THEN Console("fast finished first") ' fast finished firstIF NOT TaskDone(slow) THEN Console("slow still running") ' slow still runningCANCELTASK slowENDSlow: Wait(10)RETURN 1Fast: Sync()RETURN 2Nel manuale : Il game loop e i task