Variable Reference?
BlitzMax Forums/BlitzMax Beginners Area/Variable Reference?
| ||
Hey, Is there a way to create a variable 'reference' that when changed, the original variable is also changed? I've taken a look at pointers, but I'm a bit confused by them. Any help is appreciated. |
| ||
You can use Var for that. |
| ||
Huh. I completely forgot about Var. Thanks! |
| ||
How would you go about applying Var to a field in an object? ie. Type TFoo Field num% Var End Type That doesn't seem to work. |
| ||
In the case of a field, you'd have to use a pointer, but I wouldn't advise that sort of thing. You'd be better off synchronizing the values between objects in some sort of explicit (in this case, meaning you have code to do it manually) manner. |
| ||
Alright, thanks. |