Skip to main content

Not Or (NOR) ('!)

Tests if both operands have values of FALSE.

Details

The Not Or operator produces a result of TRUE (1) if both operands have values of FALSE. The Not Or operation produces a result of FALSE (0) if either operand has a value of TRUE or if both operands are TRUE.

The || Or operator cannot be prefixed with a Not operator: the format '|| is not supported. However, the following format is supported:

'(operand || operand)

Examples

The following Not Or examples evaluate two false operands and produce a TRUE result.

 SET A=0,B=0
 WRITE "A'!B = ",A'!B   // Returns 1
 SET A=0,B=0
 WRITE "'(A!B) = ",'(A!B)   // Returns 1

The following Not Or examples evaluate one TRUE and one false operand and produce a result of FALSE.

 SET A=0,B=1
 WRITE "A'!B = ",A'!B   // Returns 0
 SET A=0,B=1
 WRITE "'(A!B) = ",'(A!B)   // Returns 0

The following Not Or (||) example evaluates the left operand, and because it is TRUE (1) does not evaluate the right operand. The Not inverts the resulting boolean value, so the expression returns FALSE (0).

 SET A=1
 WRITE "'(A||B) = ",'(A||B)   // Returns 0
FeedbackOpens in a new tab