Equinox Online Help

Home

Logical operations

A logical operation is an expression whose operands are either True or False and returns either True or False. Mathematically False is equivalent to zero and True is equivalent to any non-zero integer (usually one). Consider the following example:

logical result | variable declaration
result = 1 < 7 Xor 5 > 6

In this case, result is True because 1 < 7 is True, 5 > 6 is False and True Xor False is True. You can use logical expressions where operands are of different types. If you do, Equinox converts the left hand operand to same type as the right hand one. Consider the following:

if 1 < "a" then
...
end if

Here, the number value 1 is converted to the string "1". Now consider the reverse:

if "a" > = 1 then
...
end if

Now, the string "a" is converted to a number value (zero in this case).