Page 1 of 1

Referencing variables of a "Reference"

Posted: 06 Jan 2013 10:23
by psykel
Been looking into how to pull this off, seems trivial. Basically I create a references using getObject(), but I want to then reference that items "x" variable, but I seem to not be able too. For reference I would assume this:

Code: Select all

decl self = getobject();
self.x = {0,OSC_ARGS};
but that doesn't compile. I want to use references because I don't want to have to change a ton of script names because this particular object will be duplicated a bunch...

What am I missing?

Re: Referencing variables of a "Reference"

Posted: 10 Jan 2013 13:44
by nick_liine
psykel wrote:Been looking into how to pull this off, seems trivial. Basically I create a references using getObject(), but I want to then reference that items "x" variable, but I seem to not be able too. For reference I would assume this:

Code: Select all

decl self = getobject();
self.x = {0,OSC_ARGS};
but that doesn't compile. I want to use references because I don't want to have to change a ton of script names because this particular object will be duplicated a bunch...

What am I missing?
What you're looking for is:

Code: Select all

decl self_x =  getexpression(self,'x');
self_x = {0,OSC_ARGS};