finding the length of a 2d array

BlitzMax Forums/BlitzMax Beginners Area/finding the length of a 2d array

I was wondering what would be the best method to get the height and width of a 2d array? I need this for an OpenGL terrain drawing function I'm hard at work on. ;)

How's this?
Local arr[3,5]

Print "Width  = " + arr.Dimensions()[0]
Print "Height = " + arr.Dimensions()[1]
.Dimensions() returns an array with an entry for the size of each array dimension.


Ah OK thank you very much. I was confused how to use the Dimensions call. They used it with an "eachin()" in the manual adding confusion.

Thanks Wendell, I didn't know you could use [] in that way!