Returning Blitz Arrays from Functions

Blitz3D Forums/Blitz3D Beginners Area/Returning Blitz Arrays from Functions

Elendia Starman(Posted 2008) [#1]
how exactly do you return blitz arrays?


Lagrange(Posted 2008) [#2]



It seems that Blitz passes blitzarrays by reference:
when you're changing the values of the "temp"- array you're actually changing the values of the "a"-array.

You don't need to use any "Return" command.

(That's also new to me, never used blitzarrays that way)


GIB3D(Posted 2008) [#3]
Yea isn't that awesome? Very usefull


Elendia Starman(Posted 2008) [#4]
well, for one a[2] is global
second...my code tries to take two vectors (v[3] and f[3]) and return the resultant f2[3]

I might figure out a way to use what you were talking about to work around my problem...

EDIT:
I got it working!

For anyone else, the way you do it is to pass the array you want returned and simply do your calculations with the others and change the values of the "returning" array.