With regards to state logic and the VTS scripting language,
any expression that contains an Invalid, whether it be in combination with the
"
", "-", "*", "/", "&&", or "||"
operators (see Operators), is expected to return
Invalid unless PickValid is employed. There is one
exception to this rule; that is, if an expression contains an Invalid and a "0",
then the result will be a "0", as Boolean logic dictates that anything anded
with a "0" is always a "0". The underlying principle being an attempt to always
return a valid result whenever possible.
For example:
Invalid && 0 = 0
Invalid && 1 = Invalid
Invalid || 1 = 1
Some common operators and the result when used in Boolean expressions are described below.
AND
Two or more items must agree (i.e. must be evaluated to the same result) in order for the expression to be true.
1 AND 1 = TRUE
0 AND 1 = FALSE
1 AND 0 = FALSE
0 AND 0 = FALSE
1 AND 1 AND 1 = TRUE
1 AND 1 AND 0 = FALSE
OR
One, both, or more items must agree. If both inputs are false, the result is false.
1 OR 1 = True
0 OR 1 = True
0 OR 0 = False
NOT
Reverses the input. If true is input, the result is false; if false is input, the result is true.
1 would evaluate to FALSE
0 would evaluate to TRUE
XOR (eXclusive OR)
Only one input may be true; if both inputs are true, the entire result is false.
1 XOR 1 = FALSE
1 XOR 0 = TRUE
0 XOR 1 = TRUE
0 XOR 0 = FALSE