array dimensions
BlitzMax Forums/BlitzMax Programming/array dimensions
| ||
In my prgm, one function has an array passed in as a parameter. Is there anyway to find out the dimensions of the array without having extra variables? Such as ArrayWidth(m:Int[]) or ArrayHeight(m:Int[]). Is this possible? |
| ||
len(myArray[]) or I believe you can do: myArray.Length *EDIT* if you are using the arrays within arrays trick then you can get both width and height with this. |
| ||
Maybe a silly question but I'm new here :) No multidimensional arrays? Ok, so I know I can use a one dimensional array and some simple arithmetic, or even a list. Sometimes, though, you just can't beat map[x][y] :) Am I missing something? |
| ||
There are multi-dimensional arrays. From the Wiki... http://www.peppermedia.net/blitzwiki/index.php/Arrays#Multi-Dimensional_Arrays |
| ||
Ngggggg Thanks for that :) |
| ||
Undocumented: Local a:Int[2,2,2] Print a.numberOfDimensions 'Prints 3 |
| ||
Also undocumented:Local a:Int[2,2,2] Print a.numberOfDimensions 'Prints 3 Print a.elementTypeEncoding[0] 'Prints 105 if Int, 102 if Float, 36 if String Print a.sizeMinusHeader |