The 'On GoSub' statement exists in Gambas since version 3.2.
Jumps to one of the calculated labels. The evaluation of 'Expression' must result in an integer value to select a (target) label. If there is a return statement in the instructions after the target(-Label), the program returns to execute the code immediately after the 'On GoSub' statement.
On Expression GoSub Label_0 [ , Label_1 ... ] Instruction(s) -> program continuation after RETURN Label_0: Instruction(s)_0 RETURN Label_1: Instruction(s)_1 RETURN …
Articles