HP Pascal/iX Reference Manual (31502-90022)

4-: 10
Example
VAR
bit6, bit7 : Boolean;
counter : integer;
BEGIN
...
IF bit6 AND bit7 THEN counter := 0;
...
IF bit6 AND (counter = 0) THEN bit7 := true;
bit7 := bit6 AND (counter = 0);
END
NOT
This Boolean operator complements the value of the Boolean expression
following the NOT operator. The result is of type Boolean. The truth
table for NOT is given below.
OPERATOR RESULT
NOT The logical negation of a single Boolean operand,
such that:
(logical negation)
-----------------------------
| | |
| a | NOT a |
| | |
-----------------------------
| | |
| false | true |
| | |
| true | false |
| | |
-----------------------------
Example
PROGRAM show_not(input,output);
VAR
time, money : Boolean;
line : string[255];
test_file : text;
BEGIN
.
.
IF NOT (time AND money) THEN wait;
.
.
WHILE NOT eof(test_file) DO
BEGIN
readln(test_file,line);
writeln(line);
END;
.
.
END.
OR
This Boolean operator is used to perform the logical inclusive OR
operation on two Boolean operands. The result is the logical OR of its
two factors. The OR operator is shown below in terms of its truth table.
OPERATOR RESULT
OR The evaluation of two Boolean operands produces a
Boolean result, such that:
(inclusive or)