ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage functions / Standard functions / Windows functions / Windows Event functions
  • Tips
  • Note
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Allows you to:
  • define a timeout,
  • give control back to Windows,
  • give control back to Windows and to WLanguage.
iPhone/iPad Warning: The Multitask function MUST NOT be used to fill RepeatString, List or Multiline Zone control fields. In this case, use a Timer: each time the Timer is called, an item is added to the field.
Example
// Boucle de calcul
FOR i = 1 TO 10000
	ProcédureCalcul(i)
	// On rend la main au système pour afficher les résultats
	Multitask()
END
// Attendre 1 seconde 
Multitask(100)
Syntax
Multitask([<Timeout>])
<Timeout>: Optional integer or optional Duration
  • Perform a delay: <Delay> = positive integer.
    The execution of the application is interrupted during <Timeout> 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 <Delay> = 1, the application immediately returns control to Windows, without waiting 1 hundredth of a second.
    AndroidAndroid Widget The modification of window size is not ignored. On the contrary, the mouse clicks and the actions on the keyboard keys are ignored.
    AndroidAndroid Widget The positive values are ignored on Android. If the parameter of the function is positive, it will be processed like a negative integer.
    iPhone/iPad The positive values are not allowed.
  • Handing control back to the system: <Delay> = 0 or not specified.
    The system ends the current processes, gives control back to the WINDEV, WEBDEV or WINDEV Mobile application, then takes into account the clicks and the actions performed on the keyboard keys.
    AndroidAndroid Widget Multitask has no effect if <Timeout> = 0.
    iPhone/iPad The value 0 is not allowed on iPhone/iPad.
  • Return control to Windows and WLanguage: <Delay> = negative integer.
    The execution of the application is interrupted during <Timeout> 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 <Temporisation> = -1, the application immediately returns control to Windows without waiting 1 hundredth of a second.
Note: This parameter can correspond to:
  • an integer corresponding to the number of hundredths of a second,
  • a Duration variable,
  • the duration in a readable format (e.g., '1s' or '10cs').
Remarks

Tips

  • To refresh the UI, use MultitaskRedraw.
  • The events and timers started before the execution of Multitask are managed during the timeout.
  • In a Service application, Multitask must be replaced with ServiceWait.

Note

It is recommended to use ThreadPause instead of Multitask or Timeout when using multiple threads (including the main thread of the application) if the timer does not need to process user actions.
Business / UI classification: UI Code
Component: wd300obj.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 03/28/2025

Send a report | Local help