Line: Difference between revisions
Jump to navigation
Jump to search
m (1 revision) |
mNo edit summary |
||
(4 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
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. | 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==== | ====Comments and Examples==== | ||
Program errors which are not anticipated can be handled by adding the following to any program. | Program errors which are not anticipated can be handled by adding the following to any program. | ||
00001 ON ERROR GOTO 99900 | |||
o | o | ||
o | o | ||
Line 17: | Line 18: | ||
99960 CHAIN "MENU" | 99960 CHAIN "MENU" | ||
====Related Functions | ====Related Functions==== | ||
ERR | |||
[[ERR]] | |||
====Technical Considerations==== | ====Technical Considerations==== | ||
# 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. | |||
# 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. | |||
# 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. | |||
<noinclude> | <noinclude> | ||
[[Category:Internal Functions]] | [[Category:Internal Functions]] | ||
</noinclude> | </noinclude> |
Latest revision as of 23:55, 21 May 2014
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
Technical Considerations
- 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.
- 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.
- 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.