Announcement

Collapse
No announcement yet.

Or Operator

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Or Operator

    Please add your comments and suggestions as a Reply to this thread.





    PB/WIN - OR operator

    Purpose
    The OR operator works as both a logical and a bitwise arithmetic operator.
    Syntax
    p OR q
    Remarks
    Using OR as a logical operator
    OR returns TRUE (non-zero) if and only if either or both of its operands is TRUE. Here is OR's truth table:

    Code:
    +---------------------+
    | Truth table | x | y |
    +---------------------+
    | x OR y      | T | T |
    +---------------------+
    | T           | T | F |
    +---------------------+
    | T           | F | T |
    +---------------------+
    | T           | F | F |
    +---------------------+
    | F           |   |   |
    +---------------------+
    Using OR as a bitwise arithmetic operator
    An OR mask sets selected bits of an integer-class value without affecting the other bits. To set the most significant 2 bits in &H9700, use OR with a mask of &HC000; that is, the mask contains all 0s, except for the bit positions you wish to force to 1:

    See AlsoReferences
    Last edited by Gary Beene; 28 Oct 2014, 10:02 PM.
Working...
X