1
1
Fork 0
mirror of https://github.com/DualBrain/QB64.git synced 2023-11-19 13:10:13 +00:00
QB64-website/wiki/ERL.md
2022-12-24 19:12:43 -06:00

841 B

The ERL function returns the closest previous line number before the last error.

Syntax

lastErrorLine& = ERL

Description

  • Used in an error handler to report the last line number used before the error.
  • If the program does not use line numbers, then ERL returns 0.
  • Use _ERRORLINE to return the actual code line position of an error in a QB64 program.

Example(s)

Using a fake error code to return the line number position in a program.


ON ERROR GOTO errorfix
1
ERROR 250
ERROR 250

5 ERROR 250

END
errorfix:
PRINT ERL
RESUME NEXT 

1
1
5

See Also