Topic : The GFA-Basic Compendium
Author : GFA Systemtechnik GmbH
Version : GFABasic.HYP v2.98 (12/31/2023)
Subject : Documentation/Programming
Nodes : 899
Index Size : 28056
HCP-Version : 3
Compiled on : Atari
@charset : atarist
@lang :
@default : Document not found
@help : Help
@options : +g -i -s +z
@width : 75
@hostname : STRNGSRV
@hostname : CAB
@hostname : HIGHWIRE
@hostname : THING
View Ref-FileERROR x
ERR
ERR$(x)
FATAL
x: aexp
With ERROR x, the occurrence of error number x can be simulated. (For the table
of error messages, see Appendix.) This command is particularly useful for
example, when testing an error processing routine.
The number of the error that has arisen is returned in the variable ERR and, by
means of this, one can determine the appropriate reaction to the occurrence of
a specific error.
The function ERR$(x) returns, as a string, the error message with the
number x.
The variable FATAL is true if an error in the program generates an unknown
address. This can happen, for example, when the error arose from the processing
of an operating system routine. When this happens, a RESUME or RESUME NEXT can
no longer be correctly executed.
Examples:
ON ERROR GOSUB error_trapping
INPUT "Which error do you want: ",e
ERROR e
'
PROCEDURE error_trapping
PRINT "That was error no.: ";ERR
IF FATAL
PRINT "It was a fatal error"
ENDIF
RETURN
--> The user is asked to select an error by means of its error number and it is
displayed on the screen. The program then asks for the next error number.
~FORM_ALERT(1,ERR$(100))
--> The error message with the identification 100 is displayed, i.e. the
copyright message, as an alert box.
Memo: For compiler options see sections 'Error Messages' and
'Error Numbers Instead of Bombs'.
ERR is intialized to 0 only when the editor is first started.
However, ERR is not reset to 0 at each 'Run'.
This should be considered a bug in the editor.
ERR$() will accept any value. The actual range should be -128 to 127.