version 2003 (Modified)
PROCESS PROPERTIES (process; procName; procState; procTime{; procVisible{; uniqueID{; origin}}})
Parameter | Type | Description | |
process | Number | Process number | |
procName | String | Process name | |
procState | Number | Process state | |
procTime | Number | Cumulative time taken by process in ticks | |
procVisible | Boolean | Visible (TRUE) or Hidden (FALSE) | |
uniqueID | Integer | Unique process number | |
origin | Longint | Origin 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:
Constant | Type | Value |
Aborted | Long Integer | -1 |
Delayed | Long Integer | 1 |
Does not exist | Long Integer | -100 |
Executing | Long Integer | 0 |
Hidden modal dialog | Long Integer | 6 |
Paused | Long Integer | 5 |
Waiting for input output | Long Integer | 3 |
Waiting for internal flag | Long Integer | 4 |
Waiting for user event | Long Integer | 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, 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):
Constant | Type | Value |
Web Process on 4D Client | Longint | -12 |
Web Process with Context | Longint | -11 |
Other 4D Process | Longint | -10 |
External Task | Longint | -9 |
Event Manager | Longint | -8 |
Apple Event Manager | Longint | -7 |
Serial Port Manager | Longint | -6 |
Indexing Process | Longint | -5 |
Cache Manager | Longint | -4 |
Web Process with no Context | Longint | -3 |
Design Process | Longint | -2 |
User or Custom Menus Process | Longint | -1 |
None | Longint | 0 |
Execute on Server Process | Longint | 1 |
Created from Menu Command | Longint | 2 |
Created from User Mode | Longint | 3 |
Other User Process | Longint | 4 |
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