2 Dimensional integer array

How to create a two dimensional integer array in VB?

I tried:

Dim myArray(10)(10) as integer

But that gave me an error.

What is the proper syntax?

Thanks,

Xei



Comments

  • I found it.

    Dim myArray(10, 10) as integer

    Most books don't even cover this!

    : How to create a two dimensional integer array in VB?
    :
    : I tried:
    :
    : Dim myArray(10)(10) as integer
    :
    : But that gave me an error.
    :
    : What is the proper syntax?
    :
    : Thanks,
    :
    : Xei
    :
    :
    :
    :

  • one other neat thing you can do with arrays is set it to start at 1 instead of 0, just put the following code in the general declaractions
    option base 1
    not sure if you know this already, but it can be handy sometimes.




    : I found it.
    :
    : Dim myArray(10, 10) as integer
    :
    : Most books don't even cover this!
    :
    : : How to create a two dimensional integer array in VB?
    : :
    : : I tried:
    : :
    : : Dim myArray(10)(10) as integer
    : :
    : : But that gave me an error.
    : :
    : : What is the proper syntax?
    : :
    : : Thanks,
    : :
    : : Xei
    : :
    : :
    : :
    : :
    :
    :

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories