How do I pass a multidimensional array to a function
BlitzMax Forums/BlitzMax Programming/How do I pass a multidimensional array to a function
| ||
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? |
| ||
Try:Local mya:Int[8,2] fun(mya) Function fun(p:Int[,] ) Print p.length End Function |
| ||
Holy cow! So simple! I would have never figured that out. Is that documented anywhere? Thanks big time! |
| ||
also you can return a multi-dimentional array |
| ||
You can, but in this case you don't need to as the array is passed by reference. |