ASKER
ASKER
In C# Code:
// On the next line of code the index 4 and 6 represent the total number of elements in each dimension.
int[,] test = new int[4, 6];
int d0 = test.GetUpperBound(0); // returns 3 meaning index range 0 - 3 or 4 elements for the dimension
int d1 = test.GetUpperBound(1); // returns 5 meaning index range 0 - 5 or 6 elements for the dimension
int dTotal = test.Length; // 24 for a total number of 24 element in the array
In Visual Basic .Net:
' On the next line of code the index 4 and 6 represent the highest
index for the dimension and not the number of elements in the dimension.
Dim test(4, 6) As Integer
Dim d0 As Integer = test.GetUpperBound(0) ' returns 4 meaning index range 0 - 4 or 5 elements for the deminsion
Dim d1 As Integer = test.GetUpperBound(1) ' returns 6 meaning index range 0 - 6 or 7 elements for the deminsion
Dim dTotal As Integer = test.Length ' 35 for a total number of 35 element in the array
Visual Basic .NET (VB.NET) is an object-oriented programming language implemented on the .NET framework, but also supported on other platforms such as Mono and Silverlight. Microsoft launched VB.NET as the successor to the Visual Basic language. Though it is similar in syntax to Visual Basic pre-2002, it is not the same technology,
TRUSTED BY
Also, in .Net you can have jagged arrays, so while one dimension is consistent, each element of that dimension can have it's own bound. So why don't you share where the array is coming from.