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

version 2003 (Modified)


PROCESS PROPERTIES (process; procName; procState; procTime{; procVisible{; uniqueID{; origin}}})

ParameterTypeDescription
processNumberProcess number
procNameStringProcess name
procStateNumberProcess state
procTimeNumberCumulative time taken by process in ticks
procVisibleBooleanVisible (TRUE) or Hidden (FALSE)
uniqueIDIntegerUnique process number
originLongintOrigin of the process

Description

The PROCESS PROPERTIES command returns information about the process whose process number you pass in process.

After the call:

procName returns the name of the process. Some things to note about the process name:

- If the process was started from the User environment Execute Method dialog box (with the New Process option selected), its name is "P_" followed by a number.

- If the process was started from a Custom menus item whose Start a New Process property is checked, the name of the process is "M_" or "ML_" followed by a number.

- If the process has been aborted (and its "slot" not reused yet), the name of the process is still returned. To detect if a process is aborted, test procState=-1 (see below).

procState returns the state of the process at the moment of the call. This parameter can return 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

procTime returns the cumulative time that the process has used since it started, in ticks (1/60th of a second) .

procVisible, if specified, returns TRUE if the process is visible, FALSE if hidden.

uniqueID, if specified, returns the unique process number. Actually, starting with 4D version 6.5, each process has attributed a process number to it as well as a unique process number per session. The unique number allows you to differentiate between two processes or two process sessions. It corresponds to the process number having been started during 4th Dimension's session.

origin, if specified, returns a value that describes the origin of the process. 4th Dimension offers the following predefined constants (in the "Process Type" theme):

ConstantTypeValue
Web Process on 4D ClientLongint-12
Web Process with ContextLongint-11
Other 4D ProcessLongint-10
External TaskLongint-9
Event ManagerLongint-8
Apple Event ManagerLongint-7
Serial Port ManagerLongint-6
Indexing ProcessLongint-5
Cache ManagerLongint-4
Web Process with no ContextLongint-3
Design ProcessLongint-2
User or Custom Menus ProcessLongint-1
NoneLongint0
Execute on Server ProcessLongint1
Created from Menu CommandLongint2
Created from User ModeLongint3
Other User ProcessLongint4

Note: 4D's internal processes return a negative value and the processes generated by the user return a positive value.

If the process does not exist, which means you did not pass a number in the range 1 to Count tasks, PROCESS PROPERTIES leaves the variable parameters unchanged.

Examples

1. The following example returns the name, state, and time taken in the variables vName, vState, and vTimeSpent for the current process:

   C_STRING(80; vName) ` Initialize the variables
   C_INTEGER(vState)
   C_INTEGER(vTime)
   PROCESS PROPERTIES (Current process; vName; vState; vTimeSpent)

2. See example for On Exit Database Method.

See Also

Count tasks, 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