IBM Lotus Symphony
|
Poursuit l'exécution d'un programme dans un élément SUB ou FUNCTION à la ligne de procédure indiquée par un libellé.
Voir Paramètres
Sub/Function
bloc d'instructions
GoTo Label1
Label2:
bloc d'instructions
Exit Sub
Label1:
bloc d'instructions
GoTo Label2
End Sub/Function
Utilisez l'instruction GoTo pour demander à IBM Lotus Symphony Basic de continuer l'exécution du programme à un autre point de la procédure. Ce point doit être indiqué par un libellé. Pour définir un libellé, affectez un nom suivi du signe deux-points (":").
Avertissement : Il est impossible d'utiliser l'instruction GoTo pour quitter un élément SUB ou 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 & " De Sub 1 à" : Return
Sub2:
sVar =sVar & " De Sub 2 à" : Return
Line1:
sVar =sVar & " Etiquette 1"
Line2:
sVar =sVar & " Etiquette 2"
Print sVar
End Sub