Syntax
where L is the name of a label and C is a valid input channel
number.
The ONERROR: command is used to provide directions to a special
error-handling macro, which should be found at the address specified by
the label and/or channel supplied. If the first form of the command is
issued, with no channel number being specified, the channel number is
deduced - [B/D] does not allow duplicate labels. In the third form of
the syntax, the beginning of the file associated with the input channel
is indicated. In common with other macro facilities, the channel number
can be zero, meaning the keyboard for input or the screen for output. In
such cases, a label should not be supplied. The address specified or
implied must exist at the time the command is issued.
If the fourth form of the syntax is used, any directions to an
error-handling macro are removed, and the default status restored to no
user-defined error handling. Otherwise, if this facility is activated
and an error occurs, the facility is toggled off, to avoid infinite
looping.
In the case of no ONERROR: direction being supplied and an error
occurring, the macro being processed is aborted. If the error occurred
during the initial execution of a log-in macro, the entire program is
terminated. Otherwise, control returns to the screen.
In the case of alteration (either by re-definition of the channel, or by
updating it via the REFRESH: command, or by clearing it) of the
input channel containing the label and channel number specified in an
ONERROR: command, the following steps are followed. If the
channel no longer exists, or if it exists without the specified label,
then it is as though the ONERROR: facility is switched off.
Otherwise, the facility remains switched on. If an error occurs during
the refresh process, the ONERROR: facility is switched off.
The effect of the ONERROR: command is to specify a subroutine
which should be processed when an error occurs. After the subroutine has
been processed, control should return to the line immediately following
the line where the error occurred.