PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Declaration
  • Properties specific to the description of ParallelTask variables
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
The ParallelTask type is used to handle a task, which means a procedure run by a thread in the parallel programming.
Note: See Declaring a variable for more details.
Versions 21 and later
Apple Watch This type of variable is now available in Apple Watch mode.
New in version 21
Apple Watch This type of variable is now available in Apple Watch mode.
Apple Watch This type of variable is now available in Apple Watch mode.
Versions 23 and later
Java This type of variable is now available for the Java applications.
Android Widget This type of variable is now available in Android Widget mode.
Android This type of variable is now available for the Android applications.
New in version 23
Java This type of variable is now available for the Java applications.
Android Widget This type of variable is now available in Android Widget mode.
Android This type of variable is now available for the Android applications.
Java This type of variable is now available for the Java applications.
Android Widget This type of variable is now available in Android Widget mode.
Android This type of variable is now available for the Android applications.
Example
// Declares a variable to handle a parallel task
t is ParallelTask
// Builds a parallel task and triggers its execution on a procedure
t = ParallelTaskExecute(Proc, ("First parameter", 2))
// Builds a parallel task
t is ParallelTask(Proc, ("First parameter", 2))
// Triggers the execution of parallel task
ParallelTaskExecute(t)
// Describes a parallel task
d is Description of ParallelTask
d..Procedure = Proc
d..Parameter[1] = "First parameter"
d..Parameter[2] = 2
// Builds a parallel task and triggers its execution
t is ParallelTask = ParallelTaskExecute(d)
Declaration

Declaring a parallel task that is not described Hide the details

MyVariable is ParallelTask
In this case, the task is not described. The variable will have to be assigned with an existing task or with the result of one of the functions for running parallel tasks.

Describing a parallel task via the ParallelTask type Hide the details

MyVariable is ParallelTask (<Procedure> [, <Parameters> [, <Options>]])
<Procedure>: Character string or Procedure variable
Procedure to run. This parameter can correspond to:
  • the name of 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:
  • <Parameter 1>: First procedure parameter.
  • ...
  • <Parameter N>: Nth procedure parameter.
<Options>: Optional Integer constant
Options of task to run:
ptoFullCopyHFSQLContextTriggers the immediate copy of current HFSQL context.
Recommended for example if the parallel task must take into account the current positions in the files and queries of caller context.
ptoDelayedCopyHFSQLContext
(Default value)
Triggers a light copy of HFSQL context during the first access to the HFSQL data.
ptoLightCopyHFSQLContextTriggers the immediate copy of part of current HFSQL context.
Only the directories containing the data files in HFSQL Classic mode and/or the connections in HFSQL Client/Server mode are stored.
ptoMainThreadRuns the task in the main thread.
Caution: This constant cannot be used to run a parallel task in the main thread from the main thread.
In this case, the task is described and its description cannot be modified anymore.
The task is not automatically scheduled therefore a single declaration will not trigger the execution of the task. You must call one of the functions for running tasks in order to trigger the execution of the task.

Describing a parallel task via a Description of ParallelTask Hide the details

MyVariable is ParallelTask (<Description>)
<Description>: Description of ParallelTask variable
Name of Description of ParallelTask variable describing the task.
In this case, the task is described and its description cannot be modified anymore.
The task is not automatically scheduled therefore a single declaration will not trigger the execution of the task. You must call one of the functions for running tasks in order to trigger the execution of the task.
Remarks

Properties specific to the description of ParallelTask variables

The following properties can be used to handle a parallel task:
Property nameType usedEffect
CanceledBoolean
  • True if the task is canceled,
  • False otherwise.
This property is available in read-only.
StateInteger constantTask status:
  • ptsCanceled: the parallel task is canceled (ParallelTaskCancel).
  • ptsCancelationRequested: a cancelation request was performed on the parallel task (ParallelTaskRequestCancelation).
  • ptsWaitingExecution: the parallel task is waiting to be run.
  • ptsWaitingPrevious: the parallel task waits for the execution of a previous parallel task.
  • ptsExecutionInProgress: the parallel task is currently run.
  • ptsNotScheduled: the parallel task is not scheduled.
  • ptsCompleted: the parallel task is ended.
This property is available in read-only.
IdentifierIntegerIdentifier of task. This identifier can be used for debugging purpose for example.
This property is available in read-only.
CompletedBoolean
  • True if the task is completed,
  • False otherwise.
This property is available in read-only.
ReturnedValueValue returned by the task. Caution:
  • If the task is still in progress, ..ReturnedValue waits for the end of the task.
  • If the task is completed without fatal error, the property returns the return values of the procedure of the task.
This property is available in read-only.

Note: These properties can be used via one of the following syntaxes:
  • <Variable Name>..<Property Name>
  • <Variable Name>.<Property Name>
Minimum required version
  • Version 20
This page is also available for…
Comments
Click [Add] to post a comment