English
Language : 

NSB8 Datasheet, PDF (42/158 Pages) List of Unclassifed Manufacturers – BASIC interpreter for Z80 family
grifo®
ERRSET
ITALIAN TECHNOLOGY
STATEMENT:
ERRSET <line number>, <numeric variable>, <numeric var.>
ERRSET
ACTION:
Following the execution of an ERRSET statement which specifies a line number and two variables,
the occurrence of a program error or a <control-C> (unless disabled) will cause an automatic GOTO
to the specified line number. The line number where the error occurred is assigned to the first
variable, and a numeric error code corresponding to the type of error is assigned to the second. This
process is an error trap. After a trap, further traps are disabled until a subsequent ERRSET is
executed. Execution of an ERRSET statement with no line number or variable specifications
disables error trapping.
EXAMPLES:
10 ERRSET 1000, L, E
20 ERRSET 570,E(0) ,E(1)
30 ERRSET
REMARKS:
The use of ERRSET makes possible programs which always retain control even under error
conditions. This is useful when writing software intended for use by persons who are unfamiliar with
software or computers in general. Programs written for such users may effectively “take care of
themselves”.
After a trap has occurred or trapping has otherwise been disabled, another ERRSET statement must
be executed to resume trapping mode.
When trapping is disabled, a program error causes immediate termination of the program, followed
by an error message printed to the console.
ERRSET may not be used in direct mode — error trapping does not function in direct mode. A
program with error trapping enabled will retain that mode after a STOP interruption, but trapping will
not resume until program execution continues.
Not all errors are trappable with ERRSET; those errors without error codes are not trapped. Note that
it is possible to trap the action of the <control-C> panic button as an “error”. In trapping mode,
<control-C> will always cause a trappable “error” unless the panic-button feature has been disabled
(a process described in section PERSONALIZING BASIC).
The subroutine, function, and FOR NEXT calling histories of a program remain intact after an error
trap occurs, providing the programmer with a chance to recover from the error, if possible.
ERROR MESSAGES:
Same as statement GOTO.
SEE ALSO:
Section ERROR TRAPPING
Section ERROR MESSAGES
Section PERSONALIZING BASIC
Section CONTROL-C, THE PANIC BUTTON
Page 30
NSB8
Rel. 5.10