Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Which side for search (continues...)
Message
De
25/04/2001 14:50:41
 
 
À
25/04/2001 13:29:11
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00499572
Message ID:
00499772
Vues:
34
>>>>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform