Home > CBM > BASIC > Keywords > El | |||||||||||||||||||||||||||||||
Note the 'token' is really the character codes of the keyword.
EL
Error trapping (and debugging); return the line number of the most recent error.
EL returns the line# of the most recent BASIC program error. A value of 65535 indicates no previous program error. The value is set to "no program error" on power-up and whenever CLR is executed (performed as a part of NEW and RUN commands and, in direct mode, (D)LOAD). The value is also (usually) set when an error occurs in a program. Exceptions are the special (untrappable) errors of INPUT: EXTRA IGNORED and REDO FROM START. EL is never updated by an error in direct mode. EL is typically used in a program's TRAP handler to determine where an error occured. Although the errorNumber is available from reserved variable ER, it is common to recover from the same type of error (same errorNumber) in different ways, depending on where (which line#) the error occured in the program. It may occassionaly be useful in direct mode while debugging in order to recall the line# of the last error (for example if a displayed error message scrolls off the screen while listing program lines). Like all BASIC variables, only the first two characters of the name are significant. So you may also append extra characters; you could use the name ELINE if you prefer (note the -INE would be superfluous). Like most reserved variables, a SYNTAX ERROR will be generated if you attempt to assign a value to EL. On the CBM-II series, EL is only valid in a program. In direct mode it always reads 65535 (no error line). Examples (version 3.5 and 7.0):
© H2Obsession, 2014 |