Hi,
Sorry if this has already been asked but does AGS support pass-by-reference for primitives? I have some code that would look far cleaner and more concise if any form of pass-by-reference was supported.
Thanks
Delta
nope, fraid not.
you can only pass built in objects (Character, GUI, etc) by reference.
dang. I hope the open-source devs do consider it. This means I gotta bulk up the src with repeated code.
Closest thing I could think of: you could try "boxing" values by placing them in a 1-length dynamic array and passing that:
function change(int thing[])
{
thing[0] = 20;
}
function test()
{
int thing[] = new int[1];
thing[0] = 10;
change(thing);
Display("%d", thing[0]);
}