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
Trouble setting values by siblings (Read 4791 times)
Rafter T. Sass
Full Member
*
Offline



Posts: 100
Burlington, VT
Trouble setting values by siblings
Apr 01st, 2013, 1:23am
 
I've tried this now in both agent and rule versions.

Here are agent action versions:

With a Boolean attribute:

Code:
$FinishCheck=$FinishCheck(lastSibling) 



and with a number attribute:

Code:
$ExtraTime=$ExtraTime(firstSibling) 



Just to experiment, I tried setting the DisplayExpression via lastSibling - and it worked, to my great confusion.

Is there anything obvious wrong with the above code?

Thanks!





Back to top
 
 
raughter   IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Trouble setting values by siblings
Reply #1 - Apr 1st, 2013, 8:45am
 
Note as a general point that within an agent action - unless agent sort is as per original - first/last siblings will differ so call $FinishCheck(lastSibling(original)).

Regardless, I can recreate the rule failures you report so it my be that some action codes aren't parsing all designators. As the latter can't be confirmed by a user, I suggest dropping a line to support to clarify if this the case or there is some syntax error we're missing. As 'nextSibling' works in the same context, my hunch is this is an under-the-hood issue.
Back to top
 
 

--
Mark Anderson
TB user and Wiki Gardener
aTbRef v6
(TB consulting - email me)
WWW shoantel   IP Logged
Mark Bernstein
YaBB Administrator
*
Offline

designer of
Tinderbox

Posts: 2871
Eastgate Systems, Inc.
Re: Trouble setting values by siblings
Reply #2 - Apr 1st, 2013, 11:09am
 
I just tested both firstSibling and lastSlbling in a rule, and all went well.

   $Color=$Color(firstSibling);
and
   $Color=$Color(lastSibling;
Back to top
 
 
WWW   IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Trouble setting values by siblings
Reply #3 - Apr 1st, 2013, 12:22pm
 
The above is only true if $Color is not inherited. I presume this means [attribute_name] is being checked in the wrong scope.
Back to top
 
 

--
Mark Anderson
TB user and Wiki Gardener
aTbRef v6
(TB consulting - email me)
WWW shoantel   IP Logged
Rafter T. Sass
Full Member
*
Offline



Posts: 100
Burlington, VT
Re: Trouble setting values by siblings
Reply #4 - Apr 1st, 2013, 3:19pm
 
Curiouser and curiouser.
Back to top
 
 
raughter   IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Trouble setting values by siblings
Reply #5 - Apr 1st, 2013, 3:31pm
 
I've found one possible cause that would affect 'lastSibling' and that is TB including map(-only) adornments in the sibling testing.  As adornments are only a special-case note that Tb treats differently (and paints in Map view only) I can see how this arises but likely it is not what the user would intend.

Try replacing 'lastSibling' in $AttrName(lastSibling) with a find() that returns the last note sibling.
Back to top
 
« Last Edit: Apr 1st, 2013, 3:34pm by Mark Anderson »  

--
Mark Anderson
TB user and Wiki Gardener
aTbRef v6
(TB consulting - email me)
WWW shoantel   IP Logged
Rafter T. Sass
Full Member
*
Offline



Posts: 100
Burlington, VT
Re: Trouble setting values by siblings
Reply #6 - Apr 1st, 2013, 4:57pm
 
No adornments are present anywhere in the file.

The firstSibling agent action is now working:
Code:
$ExtraTime=$ExtraTime(firstSibling(original));
 



But the lastSibling has continued to not work, despite using (original).

My workaround, which requires an additional agent, is to pass the value through the parent note. The first agent modifies the parent:
Code:
$FinishCheck=$FinishCheck(lastChild(original))
 



and the second passes it to the child:

Code:
$FinishCheck=$FinishCheck(parent(original))
 



Back to top
 
« Last Edit: Apr 1st, 2013, 5:28pm by Rafter T. Sass »  
raughter   IP Logged
Mark Bernstein
YaBB Administrator
*
Offline

designer of
Tinderbox

Posts: 2871
Eastgate Systems, Inc.
Re: Trouble setting values by siblings
Reply #7 - Apr 2nd, 2013, 10:38am
 
Note that agent OnAdd actions may be performed when the alias is added. Other children of that agent might not be added yet, so firstSibling and lastSibling of the newly-created alias might not be what you expect.

Moreover, if a note has aliases, those aliases may also satisfy the agent's query. So, "firstSibling" and "lastSibling" might refer to the original, to the newly-created alias, or to the siblings of another alias.

Back to top
 
 
WWW   IP Logged
Pages: 1
Send Topic Print