0

I've got a situation where I have an array declared:

Dim limit(255, 31) As Integer
    ...
    DecodeTable(limit(index), ... )

Later in my code, I have to pass the second rank by reference to a sub. This would be simple in a C-based language:

int limit[255][31];
    ...
    DecodeTable( limit[ index ], ... );

Not sure how many people understand that, but basically what I have to do is pass the second rank to the sub by reference. By referencing

limit(index)

the compiler throws an exception because I'm using fewer indices than the array was declared to have. Does anyone know how to do this with VB.NET?

1
Contributor
1
Reply
2
Views
12 Years
Discussion Span
Last Post by cypher
0

I think I've found my answer. It appears that you can declare arrays in VB.NET the same as you can in C-based languages (jagged-style)

Dim limit(255, 31) As Integer

can also be declared as

Dim limit(255)(31) As Integer

and so referencing only

limit(index)

is legal :)

Appreciate your interest anyway.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.