Referencing variables of a "Reference"

Discuss problems and solutions.
Post Reply
psykel
Newbie
Posts: 1
Joined: 06 Jan 2013 10:19

Referencing variables of a "Reference"

Post 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?
nick_liine
Liine Staff
Posts: 285
Joined: 01 Oct 2010 11:06

Re: Referencing variables of a "Reference"

Post 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};
Post Reply