Grim,
As Jeff suggests, you created an array of arrays (also referred to as a
Ragged or Ragged-Row Array), which is slightly different then a 2
dimensional array.
To create a 2 dimensional array 10 x 20 (11 x 21 really) you would need to
use Herfrieds or SStory's syntax of:
Dim vArray(,) As Integer
Redim vArray(10, 20)
An array of array is called a ragged array because each row does not need to
be the same length! (The ends of the rows are ragged, they don't line up).
Dim vArray()() As Integer
' size the outer array
Redim vArray(10)
For index As Integer = 0 to 10
' size each of the inner arrays
Redim vArray(index)(index)
Next
Where we have an array of arrays, where each row is 1 column longer then the
previous row.
The following article does a good job of describing the various kinds of
arrays in .NET.
Hope this helps
Jay
"The Grim Reaper" <(E-Mail Removed)> wrote in message
news:cd999o$7b3$(E-Mail Removed)...
> Dim vArray()() As Integer
> ReDim vArray(10)(20)
> vArray(10)(10) = 10 ' etc..
> ___________________________________
> The Grim Reaper
>
> "rguti" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > Hi,
> >
> > How do I create a two dimensional array?
> >
> > I have created a one dimensional doing this:
> >
> > Dim laFields As ArrayList = New ArrayList
> >
> > How about to do a 2 dimensional?
> >
> > Thanks.
> >
> >
>
>
|