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

!= (inequality)


Operator Type: 

Operator Scope of Action: 

Operator Purpose: 

Operator First Added: 

Operator Altered: 

 Operator   [other Operator type actions]

 Query   [operators of similar scope]

 Query Boolean   [other Query Boolean operators]

 Already in v5.0.0

 


The operator to test inequality (i.e. 'is not the same as') is '!=', an exclamation mark followed by an equals sign.

This operator is used either in agent queries or in the conditional part of an if(condition){action} code. It is the functional opposite of the '==' equality test.

This test cannot be meaningfully applied to Set or List type attribute data, as the entire attribute value is matched, rather than individual values as might otherwise be assumed. For these data types use the .contains() or .icontains() operators instead, noting the scope for ambiguous matching due to stemming of words ("car" with match "car", "cars" and "carrot").

Equality testing can be negated, i.e. tested for a non-match, or combined with greater/less than for a range of tests as further explored in Basic Comparison Codes.

For a case-insensitive lexical equality test, use a lowercase on-the-fly transform:

"Absquatulate".lowercase != "Absquatulate" 

If we set $MyString to "Absquatulate", then:

$MyString.lowercase != "Absquatulate" 

If $MyOtherString(Some note) has the value "Absquatulate", then:

$MyString.lowercase != $MyOtherString(Some note) 

Note the stored left-side value isn't altered, but its transformed version is used in the test giving a case-insensitive comparison. This method only works for upper/lower case comparisons; accented characters are lexically different characters regardless of case.


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


A Tinderbox Reference File : Actions & Rules : Operators : Action Operator Functional Types : Operator actions : != (inequality)