Pascal - Logical or: or

Logical OR works as follows: just in case it's the result false if both inputs are false, in all other cases the result is true. In next table you can find all possibilities:
abx
FalseFalseFalse
FalseTrueTrue
TrueFalse True
TrueTrue True
information about the table: a, b are inputs, x is result

or

Description

par1 or par2
Used keywords: or

Input


Output

If the first operand is true, then the second operand is not evaluated.
Compatible programing languages:
Object Pascal | Free Pascal

Examples

Pascal

In the source code you can find the equivalent of the above table, for easier orientation at the end of each line is a comment which shows the result.
a1 := false or false; { a1 = false}
a2 := false or true;  { a2 = true}
a3 := true  or false; { a3 = true}
a4 := true  or true;  { a4 = true}

Pascal

Even one example in what situations we can use the operation logical or:
(b or c) or a
a or true
a>1 or a<100

Pascal

Other pieces of example codes:
a or true
(10 >a or a<5)
j > 128 or false

You can find it in the following collections: logical operators
Languages: en hu cz sk