Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problems with Apostroph in variable!
Message
De
17/04/1999 16:47:25
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00209007
Message ID:
00209412
Vues:
15
>>>>Also, you're hurting yourself needlessly using ALLTRIM() in WHERE clauses; it ensures that the expression will not be Rushmore-optimizable, and depending on the SET environment, may result in unexpected matches using the = operator.
>>>>>Thanks in advance for your help!
>>>
>>>Hi Ed,
>>>Yes, the brackets are working fine.
>>>With the ALLTRIM(), I once had problems to match the values, if I don't use ALLTRIM. Is there another way to be sure, that the values match?
>>
>>Assuming that you don't have leading spaces as an issue, I'd use:
>>
>>cMyVar = 'MyTable.MyField == [" + PADR(this.Value, LEN(MyTable.MyField)) +']'
>>
>>Which uses the exactly equal comparator, and ensures that the length ofd the compare string is the same as the length of the field.
>
>Hi Ed,
>A good idea! I have a similar problem somewhere else:
>SCAN
> REPLACE This WITH That FOR !EMPTY(THAT)
>ENDSCAN
>I suppose, this also is not Rushmore optimizable, but using LEN(That)>0 does not solve it: I would have to say again LEN(ALLTRIM(That)>0, which throws me back again. Do you have a suggestion??

The SCAN...ENDSCAN is completely unnecessary, since the FOR condition loops through the table for you.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform