Xbasic

<> Not Equal To

Syntax

Result as L = Operand1 as A <> Operand2 as A

Arguments

Operand1Any Type

A value or expression of any type.

Operand2Any Type

A value or expression of any type.

Returns

ResultLogical

Returns .t., Operand1 and Operand2 are not equal, otherwise .f.

Description

The result is TRUE if the expressions on both sides of the operator are not equal, i.e. if both Operand1 and Operand2 are of different types or have different values.

Discussion

The Not Equal To operator is not case-sensitive and removes any trailing blanks when comparing strings. For a case-sensitive not equal string comparison, use the Not Exactly Matching operator.

<> Not Equal To Operator Examples:

2 is not equal to 3

? 2 <> 3
= .T.

If ZIP contains "02138"

? ZIP <> "02139"
= .T.

Comparing strings:

? "Foley " <> "foley    "
= .F.

? "Foley" <> "folley"
= .T.

See Also