I don't get arrays

Monkey Forums/Monkey Programming/I don't get arrays

GfK(Posted 2011) [#1]
Why doesn't this work?

Global myArray:Int[16]
myArray[0] = 50


It says "expecting declaration" on the second line.


Jesse(Posted 2011) [#2]
you can only assign values with in Functions and Class: fields and methods. not int the primary/main level
this works:
Global myArray:Int[16]
Function Main()
	myArray[0] = 50
End Function



GfK(Posted 2011) [#3]
Oh. thanks.