Denis,
This is related to how xBase compares strings, by default strings are compared until the string on the right of the comparison operator is exhausted and the result at that point is returned.
In VFP we can control this behavior using the SET EXACT and SET ANSI commands. SET EXACT works for Fox operations and SET ANSI works for SQL SELECT operations.
Both SET EXACT and SET ANSI work the same way, if they are OFF the comparison is to the end of the shorter string, if they are ON then the shorter string is padded with spaces to be equal in length to the longer string and then they are compared.
SET EXACT ON and SET ANSI ON are
NOT the same as ==. == compares for exact equality. An example will illustrate the difference better than discussion.
SET EXACT ON
lcVar1 = "Jim"
lcVar2 = "Jimmy"
? lcVar2 = lcVar1
? lcvar2 == lcvar1
lcvar2 = "Jim "
? lcVar2 = lcVar1
? lcvar2 == lcvar1