User guide

40
VTB USER GUIDE
Label Label1
.
Label Label2
9.3 GOSUB-RETURN
Allow to pass the control to a SOUBRUTINE and to return at the next program instruction.
Syntax
GoSub labelname
The argument labelname can be any LABEL inside the current PAGE or inside the MAIN task.
Notes
GoSub and Return can be used everywhere in the code, but they must be both included in the same PAGE or in MAIN
task. A subroutine can be composed by more than one Return instructions, but the first Return founded by the
program flow will act the return of the program to the first instruction after the last GoSub..
WARNING: The LABEL instruction is OBSOLETE. It is preferred to use the FUNCTIONS.
Example
if condition
gosub label1
else
gosub label2
endif
Label Label1
Return
Label Label2
Return
9.4 GOTO
Allows to jump to a LABEL.
Syntax
Goto labelname
The argument labelname can be any LABEL inside the current PAGE or inside the MAIN task.
Notes
Goto passes the control to a point of the program referenced by a LABEL. Unlike GOSUB the instruction RETURN isn't
necessary.
WARNING: The LABEL instruction is OBSOLETE. It is preferred to use the FUNCTIONS.
Example
if condition
goto label1
else
goto label2
endif
Label Label1
.
Label Label2