Syntax

proposition And | Or proposition

Parameters

And and Or statements have the following parameters.

ParameterDescription
propositionA logical expression consists of two or more propositions separated by either of the logical operators And or Or. Logical operators have the lowest priority of all operators and are evaluated only after all math, string, and comparison operations given in each proposition have been executed.
AndFor an expression using the And operator to be true, both propositions must evaluate to true.
OrFor an expression using the Or operator to be true, at least one of the propositions must evaluate to true.

The result of the And and Or operators is always 0 (FALSE) or 1 (TRUE).

Result Table

Proposition1Proposition2Result Using ANDResult Using OR
TRUETRUE1 (TRUE)1 (TRUE)
TRUE0 (FALSE)0 (FALSE)1 (TRUE)
FALSETRUE0 (FALSE)1 (TRUE)
FALSEFALSE0 (FALSE)0 (FALSE)

See also

Bit-wise Operators: BitAndBitOrBitNotBitXorNot()

Example

* Only assign PASS a value of 0 if the conditions are met.
if (Time GT 63) And (POINTS GE 24) then
          PASS = 0
end
/* D is set to 1 (true). E is set to 1 (true). F is set to 0 (false).*/
A = 4
B = 5
C = 0
D = A GT 3 And B LE 5
E = A And B
F = (A Or C) And (B And C)
  • No labels