Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Form - New Method - Memory Variable Behavior
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00246580
Message ID:
00246675
Views:
19
>mProduct = "" is Always True when SET EXACT is OFF. Not so when EXACT is ON. Of course empty() is the best solution here.

Ken,

The only true exact comparison of strings is the == operator. Check out the following in the command window;
lcVar1 = "Smith"
lcVar2 = "Smi"

SET EXACT OFF
?lcVar1 = lcVar2 && T
?lcVar2 = lcVar1 && F
?lcVar1 == lcVar2 && F

SET EXACT ON
?lcVar1 = lcVar2 && F
?lcVar2 = lcVar1 && F
?lcVar1 == lcVar2 && F

lcVar2 = "Smith     "
?lcVar1 = lcVar2 && T
?lcVar2 = lcVar1 && T
?lcVar1 == lcVar2 && F
That is because SET EXACT pads teh shroter string with spaces to be equal in length to the longer string before comparing them. == compares them in the usual way (SET EXACT OFF) and then checks their lengths.
Previous
Reply
Map
View

Click here to load this message in the networking platform