1 ERR The ERR function returns the number of the latest run-time error. Example 2000 IF (ERR = 50) THEN PRINT "DATA FORMAT ERROR" 2 Syntax int-var = ERR Status: 200 OK Content-Type: text/plain; charset=ISO-8859-1 Last-Modified: Mon, 23 Oct 2000 06:15:19 GMT Script-Control: X-stream-mode=1 1 Error_handling If an error occurs when your program is running, BASIC diagnoses the error and displays a message telling the nature and severity of the error, and the program line and module where the error occurred. Your program can handle most errors with WHEN ERROR constructs. A WHEN ERROR construct contains a block of code called a protected region that is monitored by the compiler for the occurrence of an error. If an error occurs within a protected region, control can be transferred to either an attached or detached handler. If you do not include an error handler, BASIC handles the error. The severity of an error determines whether or not the program aborts when the error occurs.