4D v14.3

Process state

Home

 
4D v14.3
Process state

Process state 


 

Process state ( process ) -> Function result 
Parameter Type   Description
process  Longint in Process number
Function result  Longint in 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
Aborted Longint -1
Delayed Longint 1
Does not exist Longint -100
Executing Longint 0
Hidden modal dialog Longint 6
Paused Longint 5
Waiting for input output Longint 3
Waiting for internal flag Longint 4
Waiting for user event Longint 2

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).

Example  

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 STRING(31;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 STRING(31;asProcName;$vlActualCount)
 ARRAY INTEGER(aiProcNum;$vlActualCount)

 
PROPERTIES 

Product: 4D
Theme: Processes
Number: 330

 
HISTORY 

Created: < 4D v6

 
SEE ALSO 

Count tasks
PROCESS PROPERTIES

 
ARTICLE USAGE

4D Language Reference ( 4D v12.4)
4D Language Reference ( 4D v11 SQL Release 6)
4D Language Reference ( 4D v14 R3)
4D Language Reference ( 4D v14 R2)
4D Language Reference ( 4D v13.5)
4D Language Reference ( 4D v14.3)
4D Language Reference ( 4D v14 R4)