WaitThread()
语法
Result = WaitThread(Thread [, Timeout])概要
Stop the program execution until the specified 'Thread' exits, or the optional timeout (in milliseconds) is reached. If the thread is already finished, it returns immediately.
参数
Thread The thread to wait for. This value is returned by CreateThread(). Timeout (optional) Timeout to wait, in milliseconds.
返回值
Nonzero if the thread has ended, or zero if the timeout was reached.
示例
Procedure PrintStuff(*Interval) For i = 0 To 10 PrintN(".") Delay(*Interval) Next EndProcedure If OpenConsole() thread = CreateThread(@PrintStuff(), 500) If thread ; Wait for thread to finish before we continue ; Try commenting the WaitThread function out and seeing what happens WaitThread(thread) For i = 0 To 10 PrintN("A") Delay(1000) Next EndIf EndIf
已支持操作系统
所有