Attributes - $ prefix notation

Tinderbox Icon

$Attribute notation

From v4.6.0, although legacy syntax may be supported, all references to attributes in Action code (including Rules) should use a '$' prefix.

$AttributeName=value 

$AttributeName=$AttributeName 

$AttributeName=$AttributeName(where) 

$AttributeName(where)=$AttributeName(where) 

Long term users must note that either/both the left or right-hand expressions must begin with a '$'.

Do not mix $Attribute(path) and AttributeName(pattern) syntax in a single statements, i.e. as in $AttributeName(pattern), as this will cause unexpected results. Thus, the incorrect query syntax

$AttributeName(pattern) 

is most likely actually understood by Tinderbox as "The value of attribute $AttributeName for the note whose name or path is 'pattern' ". The converse error (because of the omitted $ prefix) would be:

AttributeName(path) 

Now Tinderbox will interpret this as "match the notes whose AttributeName attribute contains the regular expression pattern 'path'". Since v4.6.0, Tinderbox has attempted to support legacy code usage alongside the new forms, but don't expect such support to continue. It is thus worth coming to an understanding of the different implications of $Attribute(path) and AttributeName(pattern). Indeeded, AttributeName(pattern) is now deprecated for String/List/Set.contains("pattern").

Examples of $Attribute(path) usage:

$Name(parent)="archives" 

if($ChildCount(parent)>6) 

Examples of Attribute(pattern) usage (in an agent query):

Name(Fred)returns noes whose title includes 'Fred'


Possible relevant notes (via "Similar Notes" feature):

Up: Attributes
Previous: Using attributes as global variables/constants   

A Tinderbox Reference File : Attributes : Attributes - $ prefix notation

Quicklinks: Attributes | Action Codes | Export Codes | Designators | Date Formats | aTbRef Site Map

[Last updated: 16 May 2012, using v5.11.1]


Search:

Google search aTbRef for:  


Creative Commons Licence

aTbRef by Mark Anderson is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.

[See aTbRef CC licence Attribution & Waiver info]

Made with Tinderbox