Arrays don't have to be global, this works perfectly fine:
doStuff()
do
loop
function doStuff()
myArray as integer[10]
for i = 0 to 9
myArray[i] = i
print(str(myArray[i]))
sync()
sleep(100)
next i
endFunction
edit: hmmm, there is something strange going on, I tried the OPs code like so:
doStuff()
do
loop
function doStuff()
dummy as integer[16] = [0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 1, 0]
msg$ = ""
For t = 0 To dummy.length
msg$ = msg$ + str(dummy[t])
Next t
do
print(msg$)
sync()
loop
endFunction
...and it isn't doing much... Must investigate
edit2: a bit of head scratching later and it would seem that locally at least, you can not both define an Array *and* assign it with values in the same call. You need break it up into two or more calls. One to define, another (or several) to assign with values.
If you must assign values to an array at the same time that you define it, it must be done at the top-level - not inside a function. This do not necessarily make it a global array (unless you say so), so if you want the changes to remain local inside the function, you merely pass it to the function. Like so:
dummy as integer[16] = [0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 1, 0]
doStuff(dummy)
do
loop
function doStuff(dummy as integer[])
msg$ = ""
For t = 0 To dummy.length
msg$ = msg$ + str(dummy[t])
Next t
do
print(msg$)
sync()
loop
endFunction