Relational operators work with all data types and return a Logical value. The following table lists the relational operators.
Relational Operators
Operator | Action | Code |
---|---|---|
|
Less than |
|
|
Greater than |
|
|
Equal to |
|
|
Not equal to |
|
|
Less than or equal to |
|
|
Greater than or equal to |
|
|
Character string comparison |
|
The == operator can be used when an exact comparison of character strings is needed. If two character expressions are compared with the == operator, the expressions on both sides of the == operator must contain exactly the same characters, including blanks, to be considered equal. The SET EXACT setting is ignored when character strings are compared using ==. See SET EXACT for more information on using the == operator to compare character strings.
You also can use the equal to (=) operator to determine if two object references refer to the same object. The following example demonstrates a simple usage:
В | Copy Code |
---|---|
CLEAR ALL X = CREATEOBJECT('Form') Y = CREATEOBJECT('Form') ? X = Y && Displays false (.F.) Z = X ? X = Z && Displays true (.T.) |