Imp operator (LotusScript® Language)

Performs a logical implication on two expressions.

Syntax

expr1 Imp expr2

Elements

expr1, expr2

Any expressions. Their values must lie within the range for Long values.

Usage

The following table explains how LotusScript® determines the result of the Imp operation.

expr1

expr2

Result

TRUE

TRUE

TRUE

TRUE

FALSE

FALSE

FALSE

TRUE

TRUE

FALSE

FALSE

TRUE

TRUE

NULL

NULL

NULL

TRUE

TRUE

FALSE

NULL

TRUE

NULL

FALSE

NULL

NULL

NULL

NULL

In addition to performing a logical implication, the Imp operator compares identically positioned bits in two numeric expressions (known as a bit-wise comparison) and sets the corresponding bit in the result according to the following table.

Bit n in expr1

Bit n in expr2

Bit n in result

1

1

1

1

0

0

0

1

1

0

0

1

Example

Dim youCanSee As Boolean, lightIsOn As Boolean
' You don't need the light to see.
youCanSee = TRUE
lightIsOn = FALSE
Print youCanSee Imp lightIsOn          ' Prints False
' You need the light to see.
youCanSee = FALSE
lightIsOn = FALSE
Print youCanSee Imp lightIsOn          ' Prints True