The designator this describes the current note (i.e.the note currently in focus). The focus of this can vary slightly by context:
- in $Rule & $Edict: the note whose rule is running
- in $OnAdd/OnRemove: the note that is being added/removed. In context, an attribute with no designator thus refers to the note running the action
- in $AgentQuery: the note that is being examined
- in $AgentAction: the alias that is being examined
- in find(), collect(), etc.: the note that is being examined
Beware of nesting changing the context. Consider the following rule:
$Text=find($MyString==$Name(this))
Although the overall context is a rule, the rule contains a find, which in turn holds the 'this' designator. Therefore in the above example 'this' is evaluated in the context of the nested find() and not as in a simple $Rule. The problem is resolved by using a different designator: see 'that'.
See also—notes linking to here:
- firstSibling
- lastSibling
- source
- my
- compositeFor(nameStr)
- OnJoin
- Links tab
- Link Actions
- AutoFetch commands
- ^if( condition )^
- eachLink(loopVar[,scope]){actions}
- adornment
- current
- original
- that
- Parentheses: attribute 'offset' references (offset addressing)
- Be aware of context of execution and addressing
- exportedString(item[, templateStr])
- expand(scope,methodStr)