Line

From Br Wiki
Jump to: navigation, search
LINE

The Line internal function returns the line number of the most recent error. When an error occurs in a procedure while PROCERR RETURN is in effect, LINE is set to -1.

Comments and Examples

Program errors which are not anticipated can be handled by adding the following to any program.

00001 ON ERROR GOTO 99900
 o
 o
99900 PRINT "Unexpected Error Number";ERR
99910 PRINT "occurred at line number";LINE
99920 PRINT
99930 PRINT "Please record this information,"
99940 PRINT "and call your dealer at once!"
99950 PAUSE
99960 CHAIN "MENU"

Related Functions

ERR

Technical Considerations

  1. There are four cases where errors occur and LINE is not set. First, LINE is not changed when an ON error statement (or default) has set to IGNORE the error condition corresponding to this error. Second, when the error code is 4273 (topic not found in help file), the system does not set LINE or ERR so that an error in attempting to use the HELP$ function in an error trapping routine will not affect the ability to use RETRY or CONTINUE. Third, the value of LINE is not affected when an error occurs in an immediate statement which has been keyed in from the keyboard; the error code for this immediate statement is displayed correctly in the status line. Fourth, the value of LINE is not affected when an undefined function causes error code 0302; instead, the name of the undefined function is displayed on the 23rd line of the screen.
  2. LINE is initialized to -1 by the following: the RUN command, PROCERR RETURN command, CLEAR or CLEAR ALL commands and any other commands which clear memory.
  3. When PROCERR RETURN is in effect, and a syntax error occurs during a LOAD SOURCE command, LINE is set to the line number of the previous line (instead of the current, unaccepted line), and control is returned to the procedure.