223 ERR error Purpose If the computer finds an error that it cannot resolve, it may give up and report the error on the screen. In addition it remembers an ‘error number’. For example, if you try to calculate with numbers which are too large for the computer it will report Too big and remember error number 20. Pressing the ESCAPE key behaves as an error (error number 17) and you can detect this and act on it if you wish. It is possible to make the computer deal with most of these errors itself by writing special sections of the program to deal with the inevitable! These sections of the program need to know what the error was and where it occurred.
The function ERR enables your program to find the error number of the last error which occurred. This is generally used to enable the program to respond helpfully to an error caused by the user. 1000 wrong=ERR Examples 100 IF ERR=17 THEN PRINT "YOU CAN'T ESCAPE!" 1230 IF ERR=18 THEN PRINT "You can't divide by zero!" Description Returns the error number of the last error which occurred. Syntax = ERR Associated keywords ON ERROR... , ON ERROR OFF , ERL , REPORT