HTBasic Help
×
Menu
Index

ERRN

Returns the last error number.
 
 ERRN
 
Usage:
A=ERRN
IF ERRN=75 THEN CALL Exroute
PRINT "Execution Error Number = ";ERRN
10  ON ERROR GOTO 90
20  PRINT X^Y
. . .
80  STOP
90  IF ERRN=27 THEN PRINT "Oops!"
 
Example:
 
 
Description:
The last program execution error number is returned; or if no error has occurred, a zero is returned. ERRNmay be used in IF statements to direct program flow in an error handling routine.
 
Porting Issues
Any error number of 2000 or greater is an HTBasic extension to Rocky Mountain Basic. Not all errors that can occur under HP BASIC can occur under HTBasic. Any error number greater than 10,000 is a Windows error passed to the error handler in HTBasic directly from Windows.
 
In general, the error numbers returned for errors are the same as those returned by HP BASIC. But in some instances the operating system or environment in which HTBasic runs makes it impossible or impractical to return the same number.
 
Appendix A contains a list of errors that can occur.
 
See Also: