Imports System
Imports Microsoft.VisualBasic
Public Class SamplesArray
Public Shared Sub Main()
Dim my1DIntArray As Array = Array.CreateInstance(GetType(Int32), 5)
Dim i As Integer
For i = my1DIntArray.GetLowerBound(0) To my1DIntArray.GetUpperBound(0)
my1DIntArray.SetValue(i + 1, i)
Next i
Console.WriteLine(my1DIntArray.GetLowerBound(0))
Console.WriteLine(my1DIntArray.GetUpperBound(0))
PrintValues(my1DIntArray)
Console.WriteLine()
Dim my3DIntArray As Array = Array.CreateInstance(GetType(Int32), 2, 3, 4)
End Sub
Public Shared Sub PrintValues(myArr As Array)
Dim myEnumerator As System.Collections.IEnumerator = myArr.GetEnumerator()
While myEnumerator.MoveNext()
Console.WriteLine(myEnumerator.Current)
End While
End Sub
End Class