Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Which side for search (continues...)
Message
 
 
To
25/04/2001 10:28:14
Chuck Tripi
University of Wisconsin - Milwaukee
Milwaukee, Wisconsin, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00499572
Message ID:
00499592
Views:
18
>BROWSE FOR ALLTRIM(UPPER(m.lo1)) $ UPPER(person.first) works
>
>BROWSE FOR UPPER(person.first) $ ALLTRIM(UPPER(m.lo1)) does NOT work
>
>What's going on? The BROW was for a test since the actual SQL does not work.
>
>Chuck

The order matters because of how VFP compares strings.
"AB  " $ "AB"   && returns .F.  The spaces are not contined in the second string
"AB"   $ "AB  " && returns .T.  The spaces are ignored in this case

With EXACT OFF
"AB  " = "AB"   && returns .T.
"AB"   = "AB  " && returns .F.
VFP stops comparing when it reaches the end of the string on the right side of the expression. If the length of the right side is greater than the length of the left side, the two expressions can never be equal. But if the length of the right side is less than the length of the right side, then they can be equivalent. They are equal up to a point.

This is also the reason that the order in a WHERE or FOR clause makes a difference.
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Previous
Reply
Map
View

Click here to load this message in the networking platform