- Name:
-
on gosub
- Syntax:
-
ON offset GOSUB address0, address1, ...addressN
Offset - is a variable/constant which specifies which subprocedure to use (0-N).
Addresses - are labels which specify which subprocedure to gosub to.
- Description:
-
Gosub address specified by offset (if in range).
This command allows a conditional gosub depending on the value of the variable 'offset'. If offset is value 0, the program flow will gosub to address0, if offset is value 1 program flow will gosub to adddress1 etc. If offset is larger than the number of addresses the whole command is ignored and the program continues at the next line. The return command of the sub procedure will return to the line after on...gosub. This command counts as a single gosub within the compiler.