Changes

Visual Basic Arrays

405 bytes added, 16:32, 3 August 2007
Accessing Array Element Values
</pre>
A ''For'' loop can also be used to interate iterate through each element of an array:
<pre>
MessageBox.Show(strColors(intCount))
Next intCount
</pre>
 
== Finding the Size of an Array ==
 
The size of an array (i.e the number of elements contained in the array) can be obtained by accessing the ''Length'' property of the specific array.
 
For example, to find out the size of the strColors array:
 
<pre>
Dim strColors(5) As String = {"Red", "Green", "Blue", "Indigo", "Violet", "Yellow" }
Dim intArraySize As Integer
 
intArraySize = strColors.Length
 
</pre>