Commodore‎ > ‎BASIC‎ > ‎Keywords‎ > ‎

EL

Keyword Abbreviation Token (hex) Version(s) Classification
EL none 45 4C 3.5, 4.7+ Reserved variable
Note the 'token' is really the character codes of the keyword.

  Syntax  
EL
 
Returns Type Value(s) Note(s)
errorLine Integer
varies
 
 
  Purpose  
Error trapping (and debugging); return the line number of the most recent error.
 
  Remarks  
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):
NEW: PRINT EL
 65535

READY.
10 JUMP OF A CLIFF
RUN

?SYNTAX ERROR IN 10
READY.
PRINT EL
 10

READY.
 
  Compare With  
 
  Compare With  
 
  See Also  
CLR, DS, DS$ER, ERR$HELP, INPUTRESUME, ST, TRAP 

© H2Obsession, 2014
Comments