or is a logical “inclusive or” operator
the or logical operator compares two expressions and returns the boolean value true if one of the expressions is true (non-zero). See the table below for possible results.
expression 1 expression 2 result true true true true false true false true true false false false
Logical operators are not to be confused with Bitwise Operators.
In this example a comparison is performed on two integer variables using an if-statement.
' SharpBASIC or programming example
' ---------------------------------
incl "lib/sys.sbi";
dim a, b: int;
main do
a = 1;
b = 0;
if a or b do
print(true);
else do
print(false);
end
end
Output:
-1