Simple array in function question

BlitzMax Forums/BlitzMax Programming/Simple array in function question

kronholm(Posted 2007) [#1]
I'm trying to do this:
Global myarray[100,100]

Function do_something(array[])
	For Local i = 0 To 99
		For Local n = 0 To 99
			array[n,i] = 0
		Next
	Next
EndFunction

do_something(myarray)


What am I doing wrong? :)

Error is: Unable to convert from Int Array to Int Array.


Gabriel(Posted 2007) [#2]
You're passing a two dimensional array to a function which is expecting a one dimensional array. Put a comma between the two square brackets in your function declaration and it will be fine.


kronholm(Posted 2007) [#3]
Ahhh! thank you gabriel!