Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Padded strings
Message
From
05/01/2002 10:08:40
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00600660
Message ID:
00601134
Views:
25
>>I get .F., .T., for the first two comparisons.
>Yeah I had them backwards.
>
>The string comparison rules are;
>
>
>SET EXACT OFF
>1. The strings are considered equal
>2. The strings are compared one character at a time
>3. If a mismatched character is hit they are considered unequal
>4. The comparison stops when the string on the right side of the = is exhausted
>
>SET EXACT ON
>1.  The shorter of the two strings is padded on the right with spaces to be
>    equal in length to the longer
>
>the rest of the comparison is the same as SET EXACT OFF
>
>==
>The string are compared the same as as set exact off, plus
>5. If the strings are still equal their lengths are compared and the result is
>   returned
>
Thanks Jim; it seems I shared in the "common misconception" you mentioned. Çetin pointed me to a quick test that showed me that I was wrong in my previous comment to you.

BTW, this isn't quite clear from the HELP. Is this behavior documented somewhere else?

Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform