Changes

Visual Basic Arrays

88 bytes added, 18:52, 3 August 2007
Initializing a Visual Basic Array
== Initializing a Visual Basic Array ==
As with other variable types, an array can be initialized during the declaration. This is achieved by encapsulating comma separated element values in braces ({}).Note that when initializing an array, it is not necessary to specify the array dimension:
The following example initializes our colors array:
<pre>
Dim strColors(5) As String = {"Red", "Green", "Blue", "Indigo", "Violet", "Yellow" }
</pre>
<pre>
Dim intNumbers(4) As Integer = { 12, 43, 33, 45, 63 }
</pre>