This version is out of date, covering development as far as v4.2.5. It is maintained here only for inbound reference links from elsewhere. Jump to the current version of aTbRef. |
A Tinderbox Reference File : Actions & Rules : Set creation operators : collect_if() operator |
collect_if() operator |
A v4.0.0 function collect_if() builds sets. (See collect() for a related new operator.
collect_if(where,condition,attribute)
builds a set by collecting all the notes corresponding to where, testing each note to see if it meets condition, and adding the value of the designated attribute to the set.
where may be any of {child,descendent,sibling,ancestor,all}. In addition, where may be argument that designates a particular (single) note other than this.
condition is a valid conditional test - i.e. it equates to true when matched.
what can be any expression, but is typically an attribute.
For example,
collect_if(child,$Status="Important",$Name)
will construct a set of the names of all of this note's important children.
Note that collect_if's function is related to agents; many tasks you might perform with collect_if could be done as well, or better, with an agent.
Up: Set creation operators | |
Previous: collect() operator | Next: links() operator |
Licensed under Creative Commons Attribution-Noncommercial-Share Alike 3.0 License
[See aTbRef CC licence Attribution/Waiver info info]