Yes.
In BlitzMAX arrays are special types of object. Objects are always passed by reference in BlitzMAX, so you don't pass the whole array to the function, nor do you return the whole array, you just pass the location in memory where the array is stored. This is only the size of an integer.
Example (a bit of a silly frivilous one, but it proves the point. The function accepts an input array, produces a new output array from it and returns it).
Framework BRL.Blitz
Import BRL.Basic
Strict
'Method One:
Local myArray:Int[]=[3,43,67,21,98]
Local outputArray:Int[]=modifyArray(myArray)
For Local i:Int = EachIn outputArray
Print i
Next
Function modifyArray:Int[](inputArray:Int[])
Local output:Int[inputArray.length]
For Local i=0 Until inputArray.length
output[i]=inputArray[i]+2
Next
Return output
End Function
|