Mega Code Archive

 
Categories / VisualBasic Script / Data Type
 

Use LBound and UBound in for statement

Sub arrayTest2()     Dim i As Integer     Dim intMyScores(10) As Integer          For i = LBound(intMyScores) To UBound(intMyScores)         intMyScores(i) = i     Next           For i = 0 To 10         Debug.Print "For array element " & i & " the number is " & intMyScores(i)     Next End Sub