End
Parameters
| None. |
Description
|
Stops the program. End shuts the program down cleanly and straight away, wherever it is called from - the middle of a function, deep inside a loop, anywhere. Run from the IDE you are dropped back into the editor; run as a built executable the program simply exits. The runtime closes the graphics mode and tidies up after you, so there is nothing to release by hand first. The usual places are the bottom of the main program, and just before the first label of a run of Gosub subroutines so the program cannot wander into them. Know which of these you actually want. End stops everything. Exit only leaves the current loop, Return only leaves the current function, and Stop is a debugging breakpoint - it drops you into the debugger, and in a run with no debugger attached it simply freezes the program rather than ending it. To finish with a message for the player, use RuntimeError instead. See also: Stop, Exit, Return, RuntimeError. |
Example
; End Example ; ----------- Print "End stops your program immediately, wherever it appears." Print "When you press a key, this program will reach End and close." Print "" Print "Press any key to End the program" WaitKey ; End quits the program - nothing after this line ever runs End Print "This line is never reached."
Index