Passing variables by reference
BlitzMax Forums/BlitzMax Beginners Area/Passing variables by reference
| ||
How can i pass variables as reference in the bmax functions? Is this possible? Like int function_reference(int & number, int & number2) in c++ |
| ||
You might mean 'Var'. |
| ||
Type var into the IDE, double click it and press F1 and you'll get the help which saysRem Var is a composite type containing a reference to a variable of the specified Type. End Rem ' the following illustrates parsing function parameters by reference Function ReturnMultiplevalues(a Var,b Var,c Var) a=10 b=20 c=30 Return End Function Local x,y,z ReturnMultipleValues(x,y,z) Print "x="+x '10 Print "y="+y '20 Print "z="+z '30 |
| ||
Oh, thank you! |
| ||
Yeah... like "Var is a composite type containing a reference to a variable of the specified Type." explains it clearly ;-) How's about. "To pass by reference, use Var, as this example demonstrates" Wish we had better documentation... In fact, it's a shame it's not as fully featured as my old Blitz Basic II manual I was just having a flick thru.... |