This version is out of date, covering development from v9.0.0 to v9.3.0. It is maintained here only for inbound reference links from elsewhere. It is no longer actively updated.

Jump to the current version of aTbRef

Tinderbox v9 Icon

first(item[,number])


Operator Type: 

Operator Scope of Action: 

Operator Purpose: 

Operator First Added: 

Operator Altered: 

 Function   [other Function type actions]

 Item   [operators of similar scope]

 Query Boolean   [other Query Boolean operators]

 Baseline

 


first("item"[,number])

Returns Boolean true if the current note is among the first number children of item. If number is missing, a value of 1 is assumed. The item parameter must be quoted unless an attribute reference. Ways to define item.

Both arguments are evaluated and can be a literal string/number, an attribute value or an action code expression evaluating to that same.

If the current note has a $SiblingOrder value of 2, then if first() is run on its parent container:

first("Note A", 5) returns true

but if 'it has a $SiblingOrder value of 7:

first("Note A", 5) returns false

This replaces the legacy #first query operator. first() also has a logical opposite in last().