Imports System
Imports Microsoft.VisualBasic
Public Class SamplesArray
Public Shared Sub Main()
Dim myLengthsArray() As Integer = {3, 5}
Dim myBoundsArray() As Integer = {2, 3}
Dim myArray As Array = Array.CreateInstance(GetType(String), myLengthsArray, myBoundsArray)
Dim i, j As Integer
Dim myIndicesArray() As Integer
For i = myArray.GetLowerBound(0) To myArray.GetUpperBound(0)
For j = myArray.GetLowerBound(1) To myArray.GetUpperBound(1)
myIndicesArray = New Integer() {i, j}
myArray.SetValue(i.ToString() + j.ToString(), myIndicesArray)
Next j
Next i
For i = 0 To myArray.Rank - 1
Console.WriteLine(myArray.GetLowerBound(i))
Console.WriteLine(myArray.GetUpperBound(i))
Next i
PrintValues(myArray)
End Sub
Public Shared Sub PrintValues(myArr As Array)
Dim myEnumerator As System.Collections.IEnumerator = myArr.GetEnumerator()
While myEnumerator.MoveNext()
Console.Write(myEnumerator.Current)
End While
End Sub
End Class