Tinderbox v11 Icon

that

With find()

The designator 'that' refers to note running a query within find() code. As expressions like find() change the meaning of 'this', that provides access to the original value of this. that is evaluated in stamps.

For instance, it makes it possible to use an attribute value from the calling notes within a find() query in an expression. In such contexts, 'this' would apply to the note being queried by find() rather than the note calling find().

For example if Note A, has 'Note B' stored in $MyString and runs a rule (or some other action code) the following would fail to test each note in find() for a $MyString value of Note B:

find($MyString(this)=="Note B") Fail!

But:

find($MyString(that)=="Note B") 

will test each note in scope of the find() query for the $MyString value stored in the calling note, i.e. Note A.

OnRemove actions

From v11.5.1. The OnRemove of a container runs on the removed note after removal. This means that unlike during OnAdd actions, the removed note cannot use parent, as the old container is not longer the actual parent. To allow for this scenario, that may be used to reference attribute values in the ex-container (instead of parent).

Note that if the OnRemove action also includes a find(), then within the operators query that still binds to the note running the code (i.e. as above).


See also—notes linking to here: