collect_if()

Tinderbox Icon

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: Full Operator List
Previous: collect()  Next: cos(argument) 

[Last updated: 1 Dec 2008]

Google search aTbRef for:  

Licensed under Creative Commons Attribution-Noncommercial-Share Alike 3.0 License
[See aTbRef CC licence Attribution/Waiver info info]

Creative Commons License

Made with Tinderbox