The SUB command defines a subroutine - a logical grouping of commands like a FUNCTION - except that unlike a FUNCTION it does not return a value or take any arguments.
Define a SUB with SUB mark: (ensure you include the colon!) End a SUB with ENDSUB.
SUBs must be placed after the main program. Having code between ENDSUB and the next SUB command is not allowed.
A SUB can be left if required before the ENDSUB statement is processed by using the RETURN command. You can call GOSUB to jump to a subroutine from within another subroutine.
A good way to create new subroutines is to use the command "new SUB" from the Project menu.
// GOSUB subcode; <-> RETURN;
PRINT a$, 0, 0
// End of main program
// From here on just SUBs
// No more code out of SUB and ENDSUB
RETURN // Back to GOSUB call
a$="Das erscheint nie / This won't appear"