|
GoTo Statement |
Format:
GoTo line
Syntax:
Remarks:
1. You cannot use a GoTo to branch from outside procudure or function
Example:
Sub GotoStatementDemo()
Number = 1 ' Initialize variable.
If Number = 1 Then
GoTo Line1
Else
GoTo Line2
end if
Line1:
MyString = "Number equals 1"
GoTo LastLine ' Go to LastLine.
Line2:
' The following statement never gets executed because Number = 1.
MyString = "Number equals 2"
LastLine:
' Print "Number equals 1" in the Output window.
Print MyString
End Sub
Copyright (c) 2000-2006 by Smartphoneware. All rights reserved.