STATUS (Statement)


Obtains the program status.


STATUS (<Program name>)


This statement stores the program status of the program designated in <Program name> using an integer.
Value
Status
1
Running
Executing
2
Stopping
Stopping in progress
3
Suspend
Suspension in progress
4
Delay
Delay in progress
5
Pending
Currently pending
6
Step Stopped
Step stoppage in progress




  • This statement cannot obtain the status of its own.
  • The status of programs being executed includes not only "1: Running" but also "4: Delay" and "5: Pending." The status varies among those three depending upon the processing state of executed commands. Given above is a program sample that judges whether programs are in execution.
  • To obtain the status of a program being called by the CALL statement, specify the name of the calling program.
    PROGRUM PRO1
    :
    CALL SUB1
    :
    In coding sample above, to obtain the status of program "SUB1" being called, specify "PRO1" as shown below. Specification of "SUB1" cannot obtain the correct program status.
    I0 = STATUS(PRO1)


DIM li1 As Integer
li1 = STATUS(samp1)
'Assigns the program status of samp1
'to li1 using an integer.
'====== Program status and processing ======
DEFINT iX
iX = STATUS(PRO1)
SELECT CASE iX
CASE 2
'Stopped
'Processing during stop
CASE 3,6
'Suspended or Step-stopped
'Processing during suspended or step-stopped
CASE ELSE
"Running, Delayed, of Pending
'Processing for executing
END SELECT


Top