Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Which side for search (continues...)
Message
From
25/04/2001 14:50:41
 
 
To
25/04/2001 13:29:11
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00499572
Message ID:
00499772
Views:
32
>>>>What about m.lo1 = "ma " and person.first should include "Mary", "Grandma", "Whatcamacallit", etc? What ALLTRIM the FIELD?
>>
>>>Then ALLTRIM() both expressions... UPPER(ALLTRIM(ex1)) $ UPPER(ALLTRIM(ex2))
>>
>>I am still not getting it. Why ALLTRIM the field? The ALLTRIM in the memory variable makes the "ma " into "ma" and then the $ search for anywhere in the field that contains the "ma" (as well the UPPER is needed, but the key issue is why ALLTRIM on BOTH sides).
>>
>>Chuck
>
>Same exact reason. Trailing spaces.
>The field value, unless it takes up the full size of the field contains trailing spaces just like the variable.
>e.g.
>Create Cursor cuTmp (cfield c(10))
>Insert Into cutmp Values ("This")
>Insert Into cutmp Values ("That")
>Insert Into cutmp Values ("Th")
>lcValue = "Those"
>Browse For cfield $ lcValue                    && EOF()
>Browse For Alltrim(cfield) $ lcValue     && 1 record
>? ["] + cfield + ["]
notice that the last line returns
"Th        "
which is not in "Th"


Just to throw another option at you:

BROWSE FOR ATC(ALLTRIM(m.lo1),first)>0

or

SELECT * FROM person WHERE ATC(ALLTRIM(m.lo1),first)>0
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Previous
Reply
Map
View

Click here to load this message in the networking platform