Process state

4D - Documentation   Français   English   German   4th Dimension 2004, Command Theme List   4th Dimension 2004, Command Alphabetical List   4th Dimension 2004, Constant Theme List   Back   Previous   Next

version 3


Process state (process) Number

ParameterTypeDescription
processNumberProcess number
Function resultNumberState of the process

Description

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:

ConstantTypeValue
AbortedLong Integer-1
DelayedLong Integer1
Does not existLong Integer-100
ExecutingLong Integer0
Hidden modal dialogLong Integer6
PausedLong Integer5
Waiting for input outputLong Integer3
Waiting for internal flagLong Integer4
Waiting for user eventLong Integer2

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)


See Also

Count tasks, PROCESS PROPERTIES.


4D - Documentation   Français   English   German   4th Dimension 2004, Command Theme List   4th Dimension 2004, Command Alphabetical List   4th Dimension 2004, Constant Theme List   Back   Previous   Next