Skip to content

ON_ERROR

Andrew Owen edited this page May 30, 2023 · 2 revisions

ON ERROR


ON ERROR GOTO {line_number|0}

Turns error trapping on or off. When line_number is set, any error causes the error handling routine starting at that line number to be called; no message is printed and program execution is not stopped. The error handling routine is ended by a RESUME statement. While in an error handling routine, events are paused and error trapping is disabled. After the RESUME statement, any triggered events are picked up in the following order: KEY, TIMER, PLAY - the order of the others is unknown. Unlike event trapping, error trapping remains active when no program is running. ON ERROR CONT turns off error trapping.

Parameters

line_number is an existing line number in the program.

Notes

It is not possible to start the error handler at line number 0.

Errors

line_number does not exist: Undefined line number.

Welcome to the SE BASIC wiki


  • Press RETURN to return to this menu.
  • Enter the name of a TOPIC to display it.
  • Enter EXIT to return to BASIC.

Choose from the following topics:

  1. Quick start guide: QUICK
  2. User's guide: USER
  3. Configuration guide: CONFIG
  4. Language guide: LANGUAGE
  5. Language reference: BASIC
  6. Technical reference: TECH
  7. Developer's guide: DEV
  8. Acknowledgemets: CREDITS
  9. Licenses: LICENSE
Clone this wiki locally