Table of Contents

10.5.8 On GoSub

The 'On GoSub' statement exists in Gambas since version 3.2.

10.5.8.1' On GoSub' syntax

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
…

10.5.8.2 Notes on the syntax

Download

Articles

Download