How do I pass a multidimensional array to a function

BlitzMax Forums/BlitzMax Programming/How do I pass a multidimensional array to a function

TAS(Posted 2012) [#1]
Local mya:Int[8,2]
fun(mya)

Function fun(p:Int[] )
Print p.length
End Function

produces the error message "Unable to convert from int[] to int[]"

Would it be possible to pass the array as object or pointer and rebuild it inside the function?


GfK(Posted 2012) [#2]
Try:
Local mya:Int[8,2]
fun(mya)

Function fun(p:Int[,] )
Print p.length	
End Function



TAS(Posted 2012) [#3]
Holy cow! So simple! I would have never figured that out. Is that documented anywhere?
Thanks big time!


Leon Drake(Posted 2012) [#4]
also you can return a multi-dimentional array


GfK(Posted 2012) [#5]
You can, but in this case you don't need to as the array is passed by reference.