GOSUB


The GOSUB statement causes execution of a local subroutine, after which execution will continue with the next line of code.

 

COMMAND SYNTAX

GOSUB label[:]

 

SYNTAX ELEMENTS

The label should refer to an existent label within the current source code. This label denotes the start of a local subroutine. Labels can be numeric or alphanumeric but an alphanumeric label must be terminated with a colon when used to denote the start of a local subroutine. Numeric labels can be terminated with a colon but it is not mandatory. The use of the colon in the GOSUB statement is optional.

 

EXAMPLES

GOSUB Initialize ;* open files etc..
GOSUB Main ;* perform main program
GOSUB Finish ;* close files etc..
STOP
...

Initialize: * open files
OPEN.......
RETURN
....

Main: * main execution loop
......
RETURN

Finish: * clean up after execution
......
RETURN


jBC