== (Exactly Matching Operator)


Result as L = Operand1 as A == Operand2 as A


Operand1Any Type

A value or expression of any type.

Operand2Any Type

A value or expression of any type.



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


The Exactly Matching operator returns .T. (TRUE) if the expressions on both sides of the operator are the same type and are equal.


The Exactly Matching operator does not automatically remove trailing blanks. The two strings must match exactly, character for character, by case and by length (including blank spaces).

The opposite of "==" is "!=" ( Not Exactly Matching Operator ).

When comparing a character field to a string, remember that the length of the field is pre-defined. If the field is assigned fewer characters than its defined length, the remainder of the field is padded with spaces.


Since the number of trailing blanks are different

? "Foley" == "Foley    "
= .F.

Since the case is different

? "Foley" == "foley"
= .F.

See Also