Public Class SamplesArray2
Public Shared Sub Main()
Dim myArr As Array = Array.CreateInstance(GetType(Int32), 2, 3, 4)
Dim i As Integer
For i = myArr.GetLowerBound(0) To myArr.GetUpperBound(0)
Dim j As Integer
For j = myArr.GetLowerBound(1) To myArr.GetUpperBound(1)
Dim k As Integer
For k = myArr.GetLowerBound(2) To myArr.GetUpperBound(2)
myArr.SetValue(i * 100 + j * 10 + k, i, j, k)
Next k
Next j
Next i
Console.WriteLine(myArr.Rank)
Console.WriteLine(myArr.Length)
For i = 0 To myArr.Rank - 1
Console.WriteLine(i)
Console.WriteLine(myArr.GetLength(i))
Console.WriteLine(myArr.GetLowerBound(i))
Console.WriteLine(myArr.GetUpperBound(i))
Next i
PrintValues(myArr)
End Sub
Public Shared Sub PrintValues(myArr As Array)
Dim myEnumerator As System.Collections.IEnumerator = myArr.GetEnumerator()
While myEnumerator.MoveNext()
Console.Write(ControlChars.Tab + "{0}", myEnumerator.Current)
End While
Console.WriteLine()
End Sub
End Class