Syntax |
expression1 Or expression2 |
|||||
Description |
Performs a logical or binary disjunction on two expressions. |
|||||
Comments |
If both expressions are either Boolean, Boolean variants, or Null variants, then a logical disjunction is performed as follows: |
|||||
|
If the first |
and the |
then: |
|||
|
TRUE |
TRUE |
TRUE |
|||
|
TRUE |
FALSE |
TRUE |
|||
|
TRUE |
NULL |
TRUE |
|||
|
FALSE |
TRUE |
TRUE |
|||
|
FALSE |
FALSE |
FALSE |
|||
|
FALSE |
NULL |
NULL |
|||
|
NULL |
TRUE |
TRUE |
|||
|
NULL |
FALSE |
NULL |
|||
|
NULL |
NULL |
NULL |
|||
|
Binary Disjunction If the two expressions are Integer, then a binary disjunction is performed, returning an Integer result. All other numeric types (including Empty variants) are converted to Long and a binary disjunction is then performed, returning a Long result. Binary disjunction forms a new value based on a bit-by-bit comparison of the binary representations of the two expressions according to the following table: |
|||||
|
1 |
Or |
1 |
= |
1 |
Example |
|
0 |
Or |
1 |
= |
1 |
5 10101001 |
|
1 |
Or |
0 |
= |
1 |
6 01101010 |
|
0 |
Or |
0 |
= |
0 |
Or 11101011 |
Example 1 |
This first example shows the use of logical Or. Sub Main() |
|||||
Example 2 |
This second example shows the use of binary Or. Sub Main() TryAgain: w = Cint(s$) |
|||||
See Also |
Operator Precedence (topic); Xor (operator); Eqv (operator); Imp (operator); And (operator). |
|||||
|
|
|
|
|
|
|
O |