Establishes (and cancels) an ON-unit that traps any condition that occurs in a block.
Enabled/Disabled status
Always enabled.
Result
Same result as that of the underlying condition.
Raised
Only in ON statements to handle any signaled condition that cannot be handled by any other ON-unit. The ANYCONDITION ON-unit executes after every other ON-unit established in the block has been examined and found not to match the signaled condition.
Restrictions
SIGNAL ANYCONDITION is not supported.
Notes
- The use of ON FINISH might be required to avoid infinite loops when using ON ANYCONDITION.
- When a condition is raised, the call stack is walked backwards to search for a block that has an ON-unit for that condition.
The search stops when the first block containing an ON ANYCONDITION unit or an ON ANYCONDITION ON-unit is found. If none are
found and the implicit action for the condition is to promote it to ERROR, the backwards walk resumed to continue searching
an ON ERROR ON-unit.
- To determine what condition is being handled, use the ONCONDID built-in function in an ANYCONDITION ON-unit, and use the ONCONDCOND
built-in function to determine the name of the CONDITION condition. You can use other ON built-in functions, such as ONFILE,
to determine the exact cause and other related information.
Other information
- Abbreviation
- ANYCOND
- Condition codes
- No unique condition codes.
- Implicit action
- Same action as that of the underlying condition.
- Normal return
- Same return as that of the underlying condition.