PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
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 have the ability to 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 is used to find out whether the secondary thread mus 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 the main thread, put 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 ALORS ThreadEnd()
    ...
Component : wd240vm.dll
Minimum version required
  • Version 19
This page is also available for…
Comments
Click [Add] to post a comment