This version is out of date, covering development from v5.0.0 to v5.12.2. It is maintained here only for inbound reference links from elsewhere.

Jump to the current version of aTbRef.

Tinderbox Icon

String Attributes - comparison operators & case sensitivity

Comparison Operators

The comparison operators available are <, <=, ==, !=, >=, and >. The == and != operators always work as a case-sensitive comparison. Examples:

$Name > $AttribName 

$AttribName > $AttribName(path) 

$Created>$Created(parent) 

$Name<$Text 

$BorderColor==$Color 

For case-sensitive matches, use String.contains("pattern"), e.g. $MyString.contains("dog"), where the pattern is a string literal or regular expression; this operator replaces the now deprecated, 'contains' pattern match, as in AttributeName(dog).

Pattern matches (via both old and new style contains) are case-sensitive by default, but when used in the context of an agent this can be modified. This is done by setting the agent's $AgentCaseSensistive attribute to False (or un-ticking the 'Case sensitive' box on the Create/Rename dialog).

Thus, a case-insensitive 'dog' pattern could match all case variants of 'dog' (dog, Dog, DOG, etc.). However, as this would also match a value of 'big dog', the degree of match of the pattern can be restricted further by regular expression string delimiters, e.g. MyAttr(^^dog$). The caret (^) forces matching to start at the beginning of the string; note that it has to be doubled so as to escape it for Tinderbox, i.e. tell the program the symbol is not - in this context - export mark-up code. Similarly, the $ forces the match to run all the way to the end of a value string. This therefore excludes longer strings that might contain the word in question. The use of the $ in a regular expression should not be confused with the $AttributeName usage, which simply references an attribute's value.


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


A Tinderbox Reference File : Deprecated Usage : References to deprecated aspects of Tinderbox : String Attributes - comparison operators & case sensitivity