!= (inequality)

Tinderbox Icon


Operator Type:   Operator
Operator Scope of Action:   Query
Operator Purpose:   Boolean (query)

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" 

$MyString.lowercase != "$MyOtherString(Agent) 

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):

Up: Query-based operators

A Tinderbox Reference File : Actions & Rules : Operators : Action Operator Scope : Query-based operators : != (inequality)

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