|
![]() |
![]() |
version 2003
PA_GetProcessInfo (pNum; pName; pState; pTime)
Parameter | Type | Description | |
pNum | long | → | Process number |
pName | char * | ← | Process name |
pState | long * | ← | Process state |
pTime | long * | ← | Process state |
Description
The routine
PA_GetProcessInfo
returns information on the process whose number is passed in
pNum
.
This works exactly like the
PROCESS PROPERTIES
command, except for the optional 4th Dimension command argument that is not handled by the routine (visible, unique ID, origin).
The
pState
parameter may contain the same values as 4th Dimension constants:
Constant | Value |
Aborted | -1 |
Delayed | 1 |
Does not exist | -100 |
Executing | 0 |
Hidden modal dialog | 6 |
Paused | 5 |
Waiting for input output | 3 |
Waiting for internal flag | 4 |
Waiting for user event | 2 |
Please refer to the 4th Dimension documentation to learn more about
PROCESS PROPERTIES
.
Example
Count the paused processes (process state is 5).
long CountPausedProcesses()
{
char name[256];
long i, state, time, totCount, pausedCount;
pausedCount = 0;
totCount = PA_CountTotalProcess();
for(i = 1; i <= totCount; i++)
{
state = 0;
PA_GetProcessInfo(i, name, &state, &time);
if(state == 5)
pausedCount++;
}
return pausedCount;
}
See Also
PA_CountTotalProcess , PROCESS PROPERTIES .
Error Handling
Use
PA_GetLastError
to see if an error occurred