Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Which side for search (continues...)
Message
De
25/04/2001 13:29:11
 
 
À
25/04/2001 11:38:38
Chuck Tripi
University of Wisconsin - Milwaukee
Milwaukee, Wisconsin, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00499572
Message ID:
00499720
Vues:
22
>>>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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform