EXCEPTSET
9.0C
The EXCEPTSET instruction enables an exception program event at the current call stack level. When an exception event is detected, a GOTO action is executed to transfer program control to a routine that handles the exception. The instruction format is one of the following:
|
|
|
|
|
|
|
|
|
|
Where:
label
Optional. A Program Execution Label.
routine
Required. A Program Execution Label assigned to the entry point of routine logic that handles the exception event.
msg
Optional. A previously defined Character String Variable that receives the exception event message.
event
Required. One of the exception program events.
char
Required. A single character literal or a Character String Variable.
Flags Affected: ZERO
Note the following:
The ZERO flag is set when an exception program event is enabled.
The exception program Events are grouped according to expected program use. The group 1 events consist of program error events including IO, CFAIL, DBFAIL, FORMAT, RANGE, PARITY, SPOOL, INTERRUPT (INT), OBJECT, and USER. The group 2 events consist of program flag events that normally are used for KEYINs. These events are ESCAPE, {char}, BACKSPACE and CANCEL characters, Function Flags (F1 - F40, UP, DOWN, LEFT, RIGHT, INS, DEL, HOME, PGUP, PGDN, END, ESCAPE (ESC), TAB, BACKTAB, and FKEY), and EVENT.
When an exception program Event is detected by the runtime, program control is transferred using a GOTO operation.
If an exception program event is enabled at a different call stack level from the stack level where the exception is detected, the call stack is unwound using RETURN instructions to reach the stack level where the exception program event can be dispatched.
By default, the exception program event is cleared at the current stack level when the event is detected. If the user program specifies the NORESET option, the exception program event is not cleared.
If the {msg} variable is not specified, the S$ERROR$ variable is used.
If a TRAP event is set and the same exception program event is set in a program, the exception program event operation takes precedence and is executed.
See Also: EXCEPTCHECK, EXCEPTCLEAR, EXCEPTDISABLE, EXCEPTDO, EXCEPTENABLE, Exceptions, Trappable Events, Program Control Instructions
![]() |