EasyManua.ls Logo

Husky Hunter - Page 201

Husky Hunter
499 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
BASIC FUNCTIONS
SECTION 5.6
ERR/ERL
5.6.4
Function ERR and ERL return the error code and the line number at
which the error occurred respectively.
Syntax
Example
X = ERR
10 GOTO 50
20 A= ERR
Y
= ERL
30 PRINT "Error Number"· A-"at line";ERL
50 ON ERROR GITTO 20 ' '
60 B=A/0
70 STOP
This example prints:
Error Number
6 at line 60
due to the floating point error caused by an attempt to
divide by zero.
Remarlks ERR and ERL will always contain the codes of the last
error, and will often be used in conjunction with ERROR.
These functions are often used in communications with the
ON ERROR GOTO trap.
NOTE: See section 4. 14 for actual error numbers.
ERR defaults to zero until an error occurs.
VER.V09F
PAGE 5 - 32