This version is out of date, covering development from v4.6.0 to v4.7.1. It is maintained here only for inbound reference links from elsewhere. Jump to the current version of aTbRef. |
|
A Tinderbox Reference File : Actions & Rules : Operators : Action Operator Scope : Conditional Group-based operators : collect_if(group,condition,attribute) | aTbRef Site Map |
collect_if(group,condition,attribute) |
Operator Type: | Set creation |
Operator Scope of Action: | Conditional Group |
A 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: Conditional Group-based operators | |
Previous: avg_if(group,condition,value) | Next: sum_if(group,condition,value) |
Licensed under Creative Commons Attribution-Noncommercial-Share Alike 3.0 License
[See aTbRef CC licence Attribution/Waiver info info]