comparison operators
Syntax
<firstOperand> = <secondOperand>
<firstOperand> is <secondOperand>
<firstOperand> ≠ <secondOperand>
<firstOperand> is not <secondOperand>
<firstOperand> < <secondOperand>
<firstOperand> > <secondOperand>
<firstOperand> <= <secondOperand>
<firstOperand> >= <secondOperand>
Explanation
SuperCard has 10 operators that compare their two operands and return either true
or `false.
=
,is
Are the two operands equal? If the operands are text, this compares without regard to case, so e.g."HOUSE" = "house"
is the same astrue
. Use<
and>
for a case-sensitive comparison.≠
,is not
Are the two operands not equal. This is the opposite of=
oris
. Again, note that case is ignored in comparison, so"HOUSE" ≠ "house"
is the same asfalse
.<
,<=
,>
,>=
compare whether one item is less/greater than the other. For numbers, that means it compares their numeric value. For text it means it compares their sort order (So e.g."Aa" < "Ab"
istrue
). Note that, different from=
, these operators are case-sensitive, so"A" < "a" or "A" > "a"
will be true, and is a good way to detect whether two equal strings differ in case.