IMP - QB64 Wiki

IMP

From QB64 Wiki

Jump to: navigation, search

The IMP logical operator converts the result of two comparative values and returns a bit result.


Syntax:

first_value IMP second_value


Description:

  • Returns a different result than AND, OR or XOR would.
  • Evaluates: first_value implies second_value.
If first_value is True then second_value must also be True.
So if first_value is True, and second_value False, then the condition is False, otherwise True (see table)


The results of the bitwise logical operations, where A and B are operands, and T and F indicate that a bit is set or not set:
Operands Operations
A B NOT B A AND B A OR BA XOR BA EQV BA IMP B
T T F T T F T T
T F T F T T F F
F T F F T T F T
F F T F F F T T
Note that the Relational Operations return negative one (-1, all bits set) and zero (0, no bits set) for true and false, respectively.
This allows relational tests to be inverted and combined using the bitwise logical operations.



See also:



Navigation:
Go to Keyword Reference - Alphabetical
Go to Keyword Reference - By usage
Go to Main WIKI Page