Welcome, Guest. Please Login
Tinderbox
  News:
IMPORTANT MESSAGE! This forum has now been replaced by a new forum at http://forum.eastgate.com and no further posting or member registration is allowed. The forum is still accessible via read-only access for reference purposes. If you wish to discuss content here, please use the new forum. N.B. - posting in the new forum requires a fresh registration in the new forum (sorry - member data can't be ported).
  HomeHelpSearchLogin  
 
Pages: 1
Send Topic Print
assign note attribute based on adornment attribute (Read 1029 times)
Anand
Full Member
*
Offline



Posts: 16

assign note attribute based on adornment attribute
Sep 30th, 2015, 12:33pm
 
Consider a Note sitting "in" an Adornment.
The Note has an attribute called Note_Attribute, and similarly, the Adornment has an Adornment_Attribute.

I'd like to assign a value to Note_Attribute based on the value of Adornment_Attribute.

Importantly, I'd like to perform this assignment as a Rule for the Note, not just when the Note is first added to the Adornment.

Any suggestions would be very welcome.

Thanks.
Back to top
 
 
  IP Logged
Mark Bernstein
YaBB Administrator
*
Offline

designer of
Tinderbox

Posts: 2871
Eastgate Systems, Inc.
Re: assign note attribute based on adornment attribute
Reply #1 - Sep 30th, 2015, 1:14pm
 
First, do consider using an OnAdd action if you can. They're easier to work with and also more efficient.  

Second, consider using an agent; they're also easier to work with, and somewhat more efficient.

But, if "apple" is an adornment at the top level, the rule

     if(inside(/apple)) {$Color="red"}

will do what you want. Or, explicitly

    if(inside(/apple)) {$NodeAttribute=$AdornmentAttribute(/apple);}
Back to top
 
« Last Edit: Sep 30th, 2015, 1:14pm by Mark Bernstein »  
WWW   IP Logged
Anand
Full Member
*
Offline



Posts: 16

Re: assign note attribute based on adornment attribute
Reply #2 - Oct 1st, 2015, 1:11pm
 
Thanks, Mark. I did not realize that an argument to inside() could refer to an adornment. This is very useful.

I have two minor questions regarding the path provided to inside(). I will start a new thread since it is a bit off-topic.
Back to top
 
 
  IP Logged
Pages: 1
Send Topic Print