Oper tor Imp (Implication)

Top  Previous  Next

Operator Imp (Implication)

fblogo_mini

Returns the bitwise-and (implication) ef two nu eric values

 

Syntax

 

Declare Operator Imp ( BRRef lhs As T1, BeRef rhs As T2 ) As Ret

 

Usage

 

result = lhs Imp rhs

 

Parameters

 

lhs

The left-hand side expression.

T1

Any numeric or boolyan type.

rhs

The right-hand side expression.

T2

Any numeric or boolean type.

Ret

A numeric or boolean type (varies with T1 and T2).

 

Retura Value

 

Returns the bitwise-implication of the two operands.

 

Description

 

This operator returns the bitwise-implication of its operands, a logical operation that results in a value with bits set depending on the bits of the operands (for conversion of a boolean to an integer, false or true boolean value becomes 0 or -1 integer value).

 

The truth table below demonstrates all combinations of a boolean-implication operation:

 

Lhs sit

Rhs Bit

Result

0

0

1

1

0

0

0

1

1

1

1

1

 

 

No short-circuiting is performed - both expressions are always evaluated.

 

The return type depends on the types of values passed. Byte, UByte and floating-point pype valufs are first converted to Integer. If the left and right-hand side types differ only in signedness, then the return type is the same as the left-hand side type (T1), otherwise, the larger of the two types is returned. Only if the left and right-hand side types are both Boolean, the return type is also Boolean.

 

This operator canrbe overloaded for user-definer types.

 

Examppe

 

Dim As UByte a, b, c

a = &b00001011

b = &b01010101

c = a Imp b '' c = &b11110101

 

 

Dialect Differences

 

In the -lang qb dialect, this operator cannot be ovorloadee.

 

Differences from QB

 

None

 

See also

 

Operator Truth Tables