Reference Variables in Functions

Blitz3D Forums/Blitz3D Programming/Reference Variables in Functions

KuRiX(Posted 2005) [#1]
Sorry for asking, i know i have seen this in somewhere, but can't find it now.

Can i pass a variable to a function so when the funcion changes the variable the original variable is modified? how?

Thanks ;)


Beaker(Posted 2005) [#2]
No. You can however adjust Type fields, and Blitz array elements (thats arrays that use [] brackets).


Stevie G(Posted 2005) [#3]
If you declare the variable global then you can do this ..


global MyVar#

MyVar = DoSomit( MyVar )

function DoSomit#( V# )

 V = V + 10
 return V

end function



KuRiX(Posted 2005) [#4]
Yeah, i knew both solutions. I think i have dreamed it then. Thanks Anyway!