HP Business BASIC/XL Reference Manual - HP 3000 MPE/iX Computer Systems - Edition 1 (32715-90001)

5-15
110 I=J/0 !The error occurred here.
120 END
200 SUB Fixit
210 PRINT ERRL
250 SUBEND
The above program prints:
110
ERRM$
The ERRM$ returns information about the last error trapped by an ON ERROR
statement. It returns an error message associated with the error number,
as listed in Appendix A.
Syntax
ERRM$
Example
100 ON ERROR CALL Fixit
110 I=J/0 !The error occurred here.
120 END
200 SUB Fixit
210 PRINT ERRM$
250 SUBEND
The above program prints:
Division by zero, or modulo 0.
ERRMSHORT$
The ERRMSHORT$ functions returns information about the last error trapped
by the ON ERROR statement. It returns an error message of the form:
ERROR
n
IN LINE
m
where
n
is the HP Business BASIC/XL error number, and
m
is the line
number that the error occurred in.
Syntax
ERRMSHORT$
Example
100 ON ERROR CALL Fixit
110 I=J/0 !The error occurred here.
120 END
200 SUB Fixit
210 PRINT ERRMSHORT$
250 SUBEND
The above program prints:
ERROR 31 IN LINE 110
ERRN
The ERRN function returns information about the last error trapped by the
ON ERROR statement. It returns the HP Business BASIC/XL error number.
Syntax
ERRN
Examples
100 ON ERROR CALL Fixit
110 I=J/0 !The error occurred here.
120 END
200 SUB Fixit
210 PRINT ERRN