Board Thread:Questions and Answers/@comment-74.139.88.16-20140108203004/@comment-9531161-20140109012436

You could put the wait at the beginning if you wanted. But before I go over that, let me make sure you know what gosub does. A regular goto simply jumps to the location you're specifying. For instance, a GOTO @BUNNIES would jump to the place labelled @BUNNIES. However, a gosub jumps to the location specified, then when it reaches a RETURN, it jumps back to just after the gosub. For instance. GOSUB @BUNNIES would jump to the place labelled @BUNNIES, and then when it reaches a RETURN, it would jump back to the instruction after GOSUB @BUNNIES.

A thing to note about GOSUBs: the code you're jumping to needs to be isolated. This is why I put it at the end and separated it from the main program with an "END". The END would stop the program from accidentally "falling into" the @WAIT section. This way, only GOSUBs let you into the "WAIT" section. Thus, if you want the @WAIT at the beginning, you could do:

GOTO @PROGRAMSTART @WAIT IF !(BTRIG AND 16) GOTO @WAIT RETURN @PROGRAMSTART INPUT NAME$ PRINT "Hello, " NAME$ "!" GOSUB @WAIT PRINT "Well, there's one more thing to do..." GOSUB @WAIT PRINT "Just kidding! That's the end!"

In this version, instead of stopping the program before it falls into the wait section, it jumps over the wait section so that it may come back to it.