Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Who's right - me or VFP?
Message
From
10/03/2005 06:20:17
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00991597
Message ID:
00994353
Views:
18
>Terry,
>
>I know this reply is a bit late in the thread but I wanted to document the comparison process completely in this thread for others to get down.
>
>SET EXACT ON
>Causes if the shorter string in a comparison to be padded with spaces to be equal in lenght to the longer string.
>
>Two strings are compared by the = sign character for character until the string on the right of the = is exhausted, so;
>
>"Jimmy" = "Jim" is True
>"Jim" = "Jimmy" is False
>
>The double equal sign == adds one more step to the comparison process, after the above comparison is complete the two strings are compared for length.
>
>"Jimmy" == "Jim" is False
>"Jim" == "Jimmy" is False
>
>Many erroneously assume that SET EXACT ON and == are the same, they are NOT as you can see below;
>
>lcStr1 = "Jim "
>lcStr2 = "Jim"
>
>SET EXACT OFF
>?lcStr1 = lcStr2 && .T.
>?lcStr1 == lcStr2 && .F.
>
>SET EXACT ON
>?lcStr1 = lcStr2 && .T.
>?lcStr1 == lcStr2 && .F.

Hey Jim,
Long time no hear. How are you doing.
Addition: Some assume == would pad with spaces automatically to match sizes. It only pads in SQL.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform