Goto
causes the execution of the program to move to a predefined label.
Label syntax is a word starting with a letter and ending with a
colon. When the program reaches the Goto keyword execution will
move to the specified line of code. B4Script
doesn't allow jumps between different subs, and the target label
must be in a scope equal or wider to the calling Goto. That is it
cannot be used to jump into a For...Next, Do...Loop or If...End If
structure. It is permissible to jump over such structures but not
land within them.
Syntax:
Goto Label
Label
- the destination line of code of the jump identified as a name as
the fist word of the line of code terminated by a colon. Further
code can follow on the same line if required.
Example:
Sub
Button1_Click
...
StartingPlace:
...
Goto
StartingPlace
End
Sub