Option Strict On
Imports System
Public Class Tester
Public Shared Sub Main()
Const rowsUB As Integer = 3 ' upper bounds
Const rowZero As Integer = 5
Const rowOne As Integer = 2
Const rowTwo As Integer = 3
Const rowThree As Integer = 5
Dim i As Integer
Dim jaggedArray(rowsUB)() As Integer
ReDim jaggedArray(0)(rowZero)
ReDim jaggedArray(1)(rowOne)
ReDim jaggedArray(2)(rowTwo)
ReDim jaggedArray(3)(rowThree)
jaggedArray(0)(3) = 15
jaggedArray(1)(1) = 12
jaggedArray(2)(1) = 9
jaggedArray(2)(2) = 99
jaggedArray(3)(0) = 10
jaggedArray(3)(1) = 11
jaggedArray(3)(2) = 12
jaggedArray(3)(3) = 13
jaggedArray(3)(4) = 14
For i = 0 To rowZero
Console.WriteLine("jaggedArray(0)({0}) = {1}", _
i, jaggedArray(0)(i))
Next
For i = 0 To rowOne
Console.WriteLine("jaggedArray(1)({0}) = {1}", _
i, jaggedArray(1)(i))
Next
For i = 0 To rowTwo
Console.WriteLine("jaggedArray(2)({0}) = {1}", _
i, jaggedArray(2)(i))
Next
For i = 0 To rowThree
Console.WriteLine("jaggedArray(3)({0}) = {1}", _
i, jaggedArray(3)(i))
Next
End Sub
End Class
|