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 was started by the Web server, its name is "Web Process#" followed by an UUID.
- 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:
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 |
- 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):
Constant |
Type |
Value |
_o_Web Process with Context |
Longint |
-11 |
Apple Event Manager |
Longint |
-7 |
Backup Process |
Longint |
-19 |
Cache Manager |
Longint |
-4 |
Client Manager Process |
Longint |
-31 |
Created from execution dialog |
Longint |
3 |
Created from Menu Command |
Longint |
2 |
Design Process |
Longint |
-2 |
Event Manager |
Longint |
-8 |
Execute on Client Process |
Longint |
-14 |
Execute on Server Process |
Longint |
1 |
External Task |
Longint |
-9 |
Indexing Process |
Longint |
-5 |
Internal 4D Server Process |
Longint |
-18 |
Internal Timer Process |
Longint |
-25 |
Log File Process |
Longint |
-20 |
Main Process |
Longint |
-1 |
Method editor macro Process |
Longint |
-17 |
Monitor Process |
Longint |
-26 |
MSC Process |
Longint |
-22 |
None |
Longint |
0 |
On Exit Process |
Longint |
-16 |
Other 4D Process |
Longint |
-10 |
Other User Process |
Longint |
4 |
Process Server Interface |
Longint |
-15 |
Restore Process |
Longint |
-21 |
Serial Port Manager |
Longint |
-6 |
SQL Method Execution Process |
Longint |
-24 |
Web Process on 4D Remote |
Longint |
-12 |
Web Process with no Context |
Longint |
-3 |
Web server Process |
Longint |
-13 |
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.
The following example returns the name, state, and time taken in the variables vName, vState, and vTimeSpent for the current process: