|
|
|
|
Wait (Function) In french: Temporisation Temporarily stops the program execution.
// Attendre 1s Wait(100, waitRedraw)
Syntax
Wait(<Timeout> [, <Type>])
<Timeout>: Integer Time to wait in hundredths of a second. - The function has no effect if a negative value is used.
- If this parameter is set to 0, the function processes all the pending events and takes control immediately.
Regardless of the parameter value, the optional processes of controls are always run.
Remark: This parameter can correspond to: - an integer corresponding to the number of hundredths of a second,
- a Duration variable,
- the direct indication of the duration ('1s' or '10cs' for example).
<Type>: Optional constant Type of event that can be run during the wait: | | waitRedraw (by default) | The windows and the controls can be redrawn. | waitNothing | No event can be run. | waitMouseAndKeyboard | The windows and the controls can be redrawn. The timers can be run. The mouse actions (click on controls for example) or the keyboard events can be run. Remark: This constant is equivalent to Multitask used with a negative value. | waitTimer | The windows and the controls can be redrawn. The timers can be run. Remark: This constant is equivalent to Multitask used with a positive value. |
Remarks The stop only affects the current thread. The other threads continue to run normally. - It is advisable to use the ThreadPause or ServiceWait function instead of the Multitask or Wait functions when multiple threads are used (including the application's main the thread) if the timer does not need to process user actions.
- Wait prevents the process from ending as long as the requested temporization is not completed. We advise you not to use a long temporization but to perform several short temporizations in a loop. For example, you can replace:
Wait(10000, waitMouseAndKeyboard)
by:
LOOP (100) Wait(100, waitMouseAndKeyboard) END
- In a Service application, Wait must be replaced by ServiceWait.
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|