Syntax
Stops the program at once. Nothing after it runs, not even the code after LOOP.
ENDGood to know
- Write
ENDon its own line. In a program without a DO loop,IF lives = 0 THEN ENDon one line is silently ignored, unless anENDon its own line also exists elsewhere. A block IF always works. - In a GOSUB subroutine,
ENDstops 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,
ENDis a compile error. Leave the function withEXITFUNCTION. ENDis not an error, so aCATCHdoes not stop it.- An
ENDon 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