ERL: Difference between revisions
Jump to navigation
Jump to search
Navigation:
Main Page with Articles and Tutorials
Keyword Reference - Alphabetical
Keyword Reference - By usage
Report a broken link
(Created page with "The ERL function returns the closest previous line number before the last error. {{PageSyntax}} : ''lastErrorLine&'' = ERL {{PageDescription}} * 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. {{PageExamples}} ''Example:'' Using a fake error code to return the line number p...") |
No edit summary |
||
Line 25: | Line 25: | ||
errorfix: | errorfix: | ||
{{Cl|PRINT}} {{Cl|ERL}} | {{Cl|PRINT}} {{Cl|ERL}} | ||
{{Cl|RESUME}} {{Cl|NEXT}} | {{Cl|RESUME}} {{Cl|NEXT}} | ||
{{CodeEnd}} | {{CodeEnd}} | ||
{{OutputStart}}1 | {{OutputStart}}1 |
Latest revision as of 01:34, 23 January 2023
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.
Examples
Example: 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