結束程序或區塊。
End、End Function、End If、End Select、End Sub
如下所示使用 End 陳述式:
End:不是必要的,但可以在程序的任意位置輸入來結束程式的執行。
End Function:結束 Function 陳述式。
End If:標記 If...Then...Else 區塊的結束。
End Select:標記 Select Case 區塊的結束。
End Sub:結束 Sub 陳述式。
Sub ExampleRandomSelect
Dim iVar As Integer
iVar = Int((15 * Rnd) -2)
Select Case iVar
Case 1 To 5
Print "Number from 1 to 5"
Case 6, 7, 8
Print "Number from 6 to 8"
Case Is > 8 And iVar < 11
Print "Greater than 8"
Case Else
Print "Outside range 1 to 10"
End Select
end sub