Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Which side for search (continues...)
Message
From
25/04/2001 13:29:11
 
 
To
25/04/2001 11:38:38
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:
00499720
Views:
24
>>>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"
Insanity: Doing the same thing over and over and expecting different results.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform