Syntax
proposition And | Or proposition
Parameters
And and Or statements have the following parameters.
Parameter | Description |
---|---|
proposition | A 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. |
And | For an expression using the And operator to be true, both propositions must evaluate to true. |
Or | For 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
Proposition1 | Proposition2 | Result Using AND | Result Using OR |
---|---|---|---|
TRUE | TRUE | 1 (TRUE) | 1 (TRUE) |
TRUE | 0 (FALSE) | 0 (FALSE) | 1 (TRUE) |
FALSE | TRUE | 0 (FALSE) | 1 (TRUE) |
FALSE | FALSE | 0 (FALSE) | 0 (FALSE) |
See also
Bit-wise Operators: BitAnd, BitOr, BitNot, BitXor, Not()
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)