PROCESS PROPERTIES

4D - Documentation   Français   English   German   Spanish   4D v11 SQL, Command Theme List   4D v11 SQL, Command Alphabetical List   4D v11 SQL, Constant Theme List   Back   Previous   Next

version 11.3 (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 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 menu 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, 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 4D's session.

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

ConstantTypeValue
Client Manager ProcessLongint-<31
Monitor ProcessLongint-26
Internal Timer ProcessLongint-25
SQL Method Execution ProcessLongint-24
MSC ProcessLongint-22
Restore ProcessLongint-21
Log File ProcessLongint-20
Backup ProcessLongint-19
Internal 4D Server ProcessLongint-18
Method editor macro ProcessLongint-17
On Exit ProcessLongint-16
Server Interface Process Longint-15
Execute on Client ProcessLongint-14
Web server ProcessLongint-13
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
Main ProcessLongint-1
NoneLongint0
Execute on Server ProcessLongint1
Created from Menu CommandLongint2
Created from execution dialogLongint3
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   Spanish   4D v11 SQL, Command Theme List   4D v11 SQL, Command Alphabetical List   4D v11 SQL, Constant Theme List   Back   Previous   Next