Table of Contents

not

not is a logical-complement operator

syntax

result = not numeric-expression

See also or, nor, and, xor, eqv, imp

details

the not logical-complement operator evaluates the numeric expression and returns its complement. See the table below.

expression    result
   true        false
   false       true

Logical operators are not to be confused with Bitwise Operators.

example

In this example a conjunction comparison is performed on two integer variables using an if-statement.

' SharpBASIC not programming example
' ----------------------------------
incl "lib/sys.sbi";

dim a, b: int;

main do
  a = 1;
  b = 0;
  if not (a and b) do
    print(true);
  else do
    print(false);
  end
end
Output:

-1