This is the legacy 4D documentation web site. Documentations are progressively being moved to developer.4d.com |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v20 R7
Process state
|
Process state ( process ) -> Function result | ||||||||
Parameter | Type | Description | ||||||
process | Longint |
![]() |
Process number | |||||
Function result | Longint |
![]() |
State of the process | |||||
The Process state command returns the state of the process whose number you pass in process.
The function result can be one of the values provided by the following predefined constants:
Constant | Type | Value | Comment |
Does not exist | Longint | -100 | |
Aborted | Longint | -1 | |
Executing | Longint | 0 | |
Delayed | Longint | 1 | |
Waiting for user event | Longint | 2 | |
Waiting for input output | Longint | 3 | |
Waiting for internal flag | Longint | 4 | |
Paused | Longint | 5 | |
_o_Hidden modal dialog | Longint | 6 | Compatibility: This process state no longer exists starting with 4D v16. An equivalent status is returned by the _o_PROCESS PROPERTIES command when procState=Waiting for user event and procMode=False. |
If the process does not exist (which means you did not pass a number in the range 1 to Count tasks), Process state returns Does not exist (-100).
The following example puts the name and process reference number for each process into the asProcName and aiProcNum arrays. The method checks to see if the process has been aborted. In this case, the process name and number are not added to the arrays:
$vlNbTasks:=Count tasks
ARRAY TEXT(asProcName;$vlNbTasks)
ARRAY INTEGER(aiProcNum;$vlNbTasks)
$vlActualCount:=0
For($vlProcess;1;$vlNbTasks)
If(Process state($vlProcess)>=Executing)
$vlActualCount:=$vlActualCount+1
PROCESS PROPERTIES($vlProcess;asProcName{$vlActualCount};$vlState;$vlTime)
aiProcNum{$vlActualCount}:=$vlProcess
End if
End for
` Eliminate unused extra elements
ARRAY TEXT(asProcName;$vlNbTasks)
ARRAY INTEGER(aiProcNum;$vlActualCount)
Product: 4D
Theme: Processes
Number:
330
Created: < 4D v6
4D Language Reference ( 4D v20 R7)