Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Alltrim strange behavior
Message
From
25/04/1999 11:49:12
 
 
To
25/04/1999 11:08:55
Christian Cote
Les Logiciels Onoma Inc.
Longueuil, Quebec, Canada
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00212015
Message ID:
00212025
Views:
27
>HI,
>I am using a syntax taht goes like this :
>SELECT Company, Address FROM Companies WHERE ALLTRIM(Address) = ALLTRIM(ThisForm.TxtAddress.Value) INTO CURSOR MyCursor
>
>My problem is that the rows selected are the ones that contain the trimmed value of Txtaddress.Value AND the the companies that has a empty address field ("").
>
>Am I missing something or what ?
>

The empty string matches everything with the compare mode you have set. Either switch to the == comparator, or change how the = works via the SET ANSI (set to ON, pads the shorter string with spaces to make it the same length as the longer string before comparing) and SET EXACT. If you want to have matches on partial strings, SET ANSI OFF and SET EXACT ON, and use the = comparator.

There's a table in the on-line help documentation for SET EXACT that would be helpful when trying to get the compare to work the way you'd like.

>Thank you for your help,
>Christian Cote
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform