/*
 * File: references.txt
 * --------------------
 */

/* You can make a variable reference, or rather become an alias for, another
   variable using ref. */
a = 15;
b ref a;

/* b is now a reference to a. The two variables are completely
   interchangeable. */
wln("b = " + tostring(b));
b = 11;
wln("a = " + tostring(a));

/* You can remove the reference with unref. */
unref b;
wln("b = " + tostring(b));
wln();

/* Here we create a reference to a sub-variable. */
objects[10].position.x = 5;
objects[10].position.y = 11;
pos ref objects[10].position;
wln("pos.x = " + tostring(pos.x));
wln("pos.y = " + tostring(pos.y));
pos.x = 47;
pos.y = 192;
wln("objects[10].position.x = " + tostring(objects[10].position.x));
wln("objects[10].position.y = " + tostring(objects[10].position.y));
unref pos;

