Private Sub Command1_Click() Dim arr(2) As String Static i As Integer arr(0) = "vb很好用!" arr(1) = "vbgood" arr(2) = "This is vb Command" If i > 2 Then i = 0 MsgBox arr(i) i = i + 1 End Sub
Private Sub Command1_Click() Dim strDoc(6) As String strDoc(0) = "aaaaa" strDoc(1) = "bbbbb" strDoc(2) = "ccccc" strDoc(3) = "ddddd" strDoc(4) = "eeeee" strDoc(5) = "fffff" Dim MyValue MyValue = Int((6 * Rnd) + 1) MsgBox strDoc(MyValue) End Sub
Dim arr(2) As String
Static i As Integer
arr(0) = "vb很好用!"
arr(1) = "vbgood"
arr(2) = "This is vb Command"
If i > 2 Then i = 0
MsgBox arr(i)
i = i + 1
End Sub
Dim strDoc(6) As String
strDoc(0) = "aaaaa"
strDoc(1) = "bbbbb"
strDoc(2) = "ccccc"
strDoc(3) = "ddddd"
strDoc(4) = "eeeee"
strDoc(5) = "fffff"
Dim MyValue
MyValue = Int((6 * Rnd) + 1)
MsgBox strDoc(MyValue)
End Sub