|
|
|
|
|
- Declaration
- Properties specific to Thread variables
- WLanguage functions that use Thread variables
Thread (Variable type) In french: Thread
The Thread type allows you to define all the characteristics of a thread. You can define and change the characteristics of this thread using different WLanguage properties. Note: For more details on the declaration of this type of variable and the use of WLanguage properties, see Declaring a variable. New in version 2025
t is Thread
t = ThreadExecute(Proc, ("First parameter", 2))
t is Thread(Proc, ("First parameter", 2))
ThreadExecute(t)
In this case, the thread is not described. The variable will have to be assigned with an existing thread or with the result of one of the thread execution functions.
Describing a thread via the Thread type Hide the details
MyVariable is Thread (<Procedure> [, <Parameters> [, <Options>]])
<Procedure>: Character string or Procedure variable Procedure to run. This parameter can correspond to: - the name of the procedure to run.
- the name of Procedure variable corresponding to the procedure to run.
<Parameters>: List of values enclosed in brackets and separated by commas Parameters of procedure to run. This list of parameters has the following format: (<Parameter 1>, ..., <Parameter N>) where: - <Paramètre 1> First parameter of the procedure.
- ...
- <Paramètre N> Nth parameter of the procedure.
<Options>: Optional Integer constant Mode for starting the thread. | | threadFullCopyHFSQLContext (Default value) | Triggers the immediate copy of the current HFSQL context. Recommended if the thread must take into account the current positions in the files and queries of caller context. | threadGlobalContext | Forces the use of the global context of the project if the thread is run from a window. The thread will continue to run until the application is closed. The window context is used by default, therefore the thread is stopped when closing the window. | threadLightCopyHFSQLContext | Triggers the immediate copy of a part of the current HFSQL context. The following are memorized: - the directories where the HFSQL Classic data files are located.
- HFSQL Client/Server connections.
| threadWaitForStart | Waits for the actual start of the thread before continuing the execution. |
In this case: - the thread is described and its description can no longer be modified.
The thread is not executed automatically, so a declaration alone will not start the execution of the thread. You must call one of the thread execution functions to start the thread execution. - thread is automatically secured. In this mode:
- a compilation error will be displayed if fields are accessed in the thread.
- an exception will be thrown:
- if the thread accesses the controls at runtime,
- if the ThreadStop function is called.
- when the window that triggered the thread is closed, a request to stop the thread is generated (but the thread continues to run after the window is closed).
Properties Properties specific to Thread variables The following properties can be used to handle Thread variables: | | | Property name | Type used | Effect |
---|
New in version 2025Extra | Variant | Allows you to store advanced information without affecting the execution of the application. You can store values of any type (array, etc.). It is also possible to add members to the Extra property. Example:
MyVariable.Extra.Info1 = Value MyVariable.Extra[Info2] = Value2 MyVariable.Extra.Date = DateSys() | Name | Character string | Thread name. This property is read-only. | Priority | Integer constant | Current priority level of thread:- High priority: High priority.
- Normal priority: Normal priority.
- Low Priority: Low Priority.
| ReturnedValue | Value returned by the thread. | Caution: - If the thread is still running, the ReturnedValue property blocks the execution until the thread terminates.
- If the thread terminates without a fatal error, the property returns the return value(s) of the main procedure of the thread.
This property is read-only. Reminder: - The State property is used to determine the state of the thread.
- It is possible to wait for the end of a thread with ThreadWait.
New in version 2025 | Status | Integer constant | Thread status: - threadStopRequested: Thread stop requested.
- threadEncours: The thread is currently running..
- threadNotExecuted: Thread not executed.
- threadSuspended: The thread is suspended.
- threadTerminated: The thread exists but is terminated..
This property is read-only. | StopRequested | Boolean | - True if the thread was requested to stop,
- False otherwise.
This property is read-only. |
Remarks WLanguage functions that use Thread variables
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|