nor
nor
nor is a logical-conjunction operator
syntax
details
the nor logical operator compares two expressions and returns the boolean value true if and only if both expressions are false (non-zero). In any other case, the result is false. See the table below.
expression 1 expression 2 result true true false true false false false true false false false true
Logical operators are not to be confused with Bitwise Operators.
example
In this example a comparison is performed on two integer variables using an if-statement.
' SharpBASIC nor programming example
' ---------------------------------
incl "lib/sys.sbi";
dim a, b: int = 0;
main do
if a nor b do
print(true);
else do
print(false);
end
end
Output:
-1
nor.txt · Last modified: 2023/06/26 10:40 by admin