───CONDITION(─┬────────┬─)──────── └─option─┘
CONDITION returns the condition information associated with the current trapped condition. You can request four pieces of information:
o
The following options (of which only the capitalized letter is needed, all others are ignored) can be used to obtain the following information:
Condition name
ON - the condition is enabled
OFF - the condition is disabled
DELAY - any new occurrence of the condition is delayed.
If no condition has been trapped (that is, there is no current trapped condition) then the CONDITION function returns a null string in all four cases.
Here are some examples:
CONDITION() -> 'CALL' /* perhaps */CONDITION('C') -> 'FAILURE' CONDITION('I') -> 'CALL' CONDITION('D') -> 'FailureTest' CONDITION('S') -> 'OFF' /* perhaps */
┴╓: The condition information returned by the CONDITION function is saved and restored across subroutine calls (including those caused by a CALL ON condition trap). Therefore, once a subroutine invoked due to a CALL ON trap has returned, the current trapped condition reverts to the current condition before the CALL took place. CONDITION returns the values it returned before the condition was trapped.