Logical Operators

The And, Or and Xor operators are named logical operators.

Integer Logical Operators

Integer logical operators are determined on the following types of operands: Integer, UInteger, Long, and ULong. When executing the logical And, Or and Xor operator, the specified operator is executed on each bit of the binary representation of the two operands.

A types extension is applied for integer logical operators to select a standard implementation.

Logical Operators for Enumerated Types

The following logical operators are determined for each enumerated type: And, Or and Xor. The result of the X Or Y operation for values of enumerated type E that has the basic type U where Or is a logical operator, is the same as the result of calculating the expression ((X As U) Or (Y As U)) As E. In other words, logical operators for enumerated types are executed by executing appropriate operations on their basic types.

Conditional Logical Operators

Conditional logical operators are used for Boolean-type operands.

The result of the operator X And Y is True if both operands are set to True. Otherwise, the result is False.

The result of the X Or Y operator is True if at least one of the operands is set to True. Otherwise, the result is False.

The result of X Xor Y operator is True if the operands have different values. Otherwise, the result is False.

See also:

Fore.NET Language Guide | Unary Operators | Arithmetic Operators