Syntax

Stops the program at once. Nothing after it runs, not even the code after LOOP.

END

Good to know

  • Write END on its own line. In a program without a DO loop, IF lives = 0 THEN END on one line is silently ignored, unless an END on its own line also exists elsewhere. A block IF always works.
  • In a GOSUB subroutine, END stops the whole program, not only the subroutine. In a program with a DO loop, the editor then reports it as an error named "BASIC END", although the stop was intended.
  • Inside a FUNCTION, END is a compile error. Leave the function with EXITFUNCTION.
  • END is not an error, so a CATCH does not stop it.
  • An END on its own line also lets Sync() and waiting subroutines yield frames in a program without a DO loop.

Example

lives = 0Console("start")   ' startIF lives = 0  ENDENDIFConsole("never shown")
In the manual : Control flow