IBM Lotus Symphony
|
Continues program execution within a Sub or Function at the procedure line indicated by a label.
See Parameters
Sub/Function
statement block
GoTo Label1
Label2:
statement block
Exit Sub
Label1:
statement block
GoTo Label2
End Sub/Function
Use the GoTo statement to instruct IBM® Lotus® Symphony™ Basic to continue program execution at another place within the procedure. The position must be indicated by a label. To set a label, assign a name, and then end it with a colon (":").
Warning: You cannot use the GoTo statement to jump out of a Sub or Function.
Sub ExampleOnGosub
Dim iVar As Integer
Dim sVar As String
iVar = 2
sVar =""
On iVar GoSub Sub1, Sub2
On iVar GoTo Line1, Line2
Exit Sub
Sub1:
sVar =sVar & " From Sub 1 to" : Return
Sub2:
sVar =sVar & " From Sub 2 to" : Return
Line1:
sVar =sVar & " Label 1"
Line2:
sVar =sVar & " Label 2"
Print sVar
End Sub