Futurebasic/Language/Reference/on stop

ON STOPEdit

StatementEdit

(+) Appearance (+) Standard Console

SyntaxEdit

ON STOP {FN userFunction|GOSUB{lineNumber|"stmtLabel"}}

DescriptionEdit

This statement designates a particular function or subroutine as a stop-event handling routine. A stop-event handling routine is called just before your program ends. This works whether your program ends as a result of a statement (such as STOP or END), or a Command-period keypress by the user, or because it has executed the last line in the program.

<spacer type="vertical" size="1">A stop-event handling routine is useful for allowing your program to do any last-minute "clean-up" work, such as saving files, before your program ends.

Note:
You can't use a stop-event handling routine to prevent your program from stopping. Your program will end as soon as it returns from the routine. To prevent the user from stopping your program by means of a -period keypress, use the ON BREAK statement.

See AlsoEdit

ON BREAK; STOP; END; SYSTEM statement