Simulates an occurrence of the error number specified. Allows a program to define its own error codes.
ERROR
numeric_expression
numeric_expression is an integer value in the range of 1 to 255.
See the Error Codes for a list of predefined error status codes. To define your own error, use an undefined error value.
The ERROR
statement assigns the error value specified to ERR and passes control to the error handler.
ON ERROR GOTO Handler
' Test error handler with error 222
ERROR 222
EndTest:
END
Handler:
PRINT "In error handler with error"; ERR
RESUME EndTest