34,333
edits
Changes
no edit summary
<pre>
Dim strColors(5) As String = {"Red", "Green", "Blue", "Indigo", "Violet", "Yellow" }
MessageBox.Show(strColors(0))
MessageBox.Show(strColors(1))
</pre>
A ''For'' loop can also be used to interate through each element of an array:
<pre>
Dim strColors(5) As String = {"Red", "Green", "Blue", "Indigo", "Violet", "Yellow" }
For intCount = 0 To 10
MessageBox.Show(strColors(intCount))
Next intCount
</pre>