I tried searching the forms, but couldn't find anything on this(it's kinda hard to search for something I don't know the keywords for.)
Simple(?) question. I have a function like so(pesudo code):
Function makeArray(passed level x width, y width, and so on)
-code to loop and build an array
-Eventually results in TempArray, a 3d array of numbers
-built from the level data passed to makeArray.
endfunction TempArray <--Returns a 0???
dim myArray(100,100,100) <-- The max level size is 100, so this gives me a blank array to write stuff into.
myArray = makeArray(passed level data, created earlier in the code)
-Results in setting the myArray variable to a big 0. So helpful, really.
In short, I need a function that returns an array. Besides the above attempt, I've also tried:
- results in compiler error, endfunction only needs one variable. Huh?
endfunction TempArray(0,0,0)
-Same result as above.
Bob = TempArray()
endfunction Bob
- Results in 0, as expected, since passing an array into a non-array object returns 0.
I tried looking in the manual, but it's entry on arrays and functions isn't very helpful since the examples only use one variable to return.
How can I return the whole array back to the rest of the program?