- Example of time-out
is used to:
- define a time-out,
- give control back to Windows,
- give control back to Windows and to WLanguage.
This function is now available for the WinDev applications on Linux.
This function is now available for the WinDev sites in Linux.
// Calculation loop
// Give control back to the system in order to display the results
// Wait 1 second
<Time-out>: Optional integer
- Define a time-out: <Time-out> = positive integer.
The execution of the application is interrupted during <Time-out> hundredths of a second without giving control back to the system. The mouse clicks and the actions performed on the keyboard keys are ignored by the application. For example, the window can be moved but it cannot be resized.
The optional processes of controls are always run.
Note: If <Time-out> = 1, the application gives control back to Windows without waiting during 1 hundredth of a second.
The positive values are not allowed.
- Give control back to Windows: <Time-out> = 0 or is not specified.
Windows ends the current processes, gives control back to the WinDev application, then takes into account the mouse clicks and the actions performed on the keyboard keys.
- Give control back to Windows and to the WLanguage: <Time-out> = negative integer.
The execution of the application is interrupted during <Time-out> hundredths of a second. Other processes can be run during this time period (redisplaying or running a click code for example). The interactions with the users (mouse click, keystroke, ...) are processed as usual.
Note: If <Time-out> = -1, the application gives control back to Windows without waiting during 1 hundredth of second.
Example of time-out
The user presses the ESC key before or during the call to 多任务
- if <Time-out> is positive: The ESC key is ignored.
- if <Time-out> is equal to 0: The ESC key is taken into account at the end of the current WinDev processes.
- if <Time-out> is negative: The ESC key is immediately taken into account.
- To refresh the display, we recommend that you use 多任务重绘.
- The events and timers started before the execution of 多任务 are managed during the time-out.
- In a Service application, 多任务 must be replaced by 服务延时.
We recommend that you use 线程暂停
instead of 多任务
when several threads are used (including for the main thread of the application) if the user actions do not have to be processed by the time-out.