finding the length of a 2d array

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

Ryan Burnside(Posted 2007) [#1]
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. ;)


WendellM(Posted 2007) [#2]
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.



Ryan Burnside(Posted 2007) [#3]
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.


Czar Flavius(Posted 2007) [#4]
Thanks Wendell, I didn't know you could use [] in that way!