ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Stops the execution of the current thread.
Example
ThreadEnd()
Syntax
ThreadEnd()
Remarks
  • If the current thread is the main thread, ThreadEnd is equivalent to EndProgram: the application is stopped.
  • To stop a secondary thread, you can implement a stop system via ThreadEnd. You have the ability to:
    • declare a Boolean global variable in the main thread (gbEnd for example). This variable determines whether the secondary thread must be stopped.
    • in the secondary thread, check the value of the variable. If it is set to True, use ThreadEnd to end the current secondary thread.
    • in main the thread, set the variable to True to force the secondary thread to stop.
    Example:
    // Code of main thread
    gbEnd is boolean
    gbEnd = False
    ...
    // Start the secondary thread
    ThreadExecute("Thread1", threadNormal, ThreadProcedure)
    ...
     
    // End the secondary thread
    gbEnd = True

    // Code of secondary thread
    ...
    IF gbEnd = True THEN ThreadEnd()
    ...
Component: wd280vm.dll
Minimum version required
  • Version 19
This page is also available for…
Comments
Click [Add] to post a comment