how to pass array to function

BlitzMax Forums/BlitzMax Programming/how to pass array to function

mrC(Posted 2005) [#1]
I have an array:

grid[x,y]

how can I pass this to a function as a parameter?

ps. Fantastic work on BlitzMax Mark!!


Robert(Posted 2005) [#2]
Easy, arrays are essentially objects, so they can be passed in a similar way:


Local grid[,]=New Int[10,10]

Function modifyGrid(grid[,])
   'Code Here
End Function



The one thing you do have to be careful of is that the number of dimensions in the array matches the number of dimensions specified in the function's definition.


mrC(Posted 2005) [#3]
Thanks very much!