Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Filter question
Message
From
31/03/2000 19:32:48
 
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Miscellaneous
Thread ID:
00353657
Message ID:
00353751
Views:
21
>I don't understand the difference between the first option and the second line of the second option. In both cases, lcCustno is a string, so what do the "[" and "]" do in the first case?
>

[] can be used as string delimiters, like '' or ""; since they're less likely to occur in most string expressions, they're a safer choice for making a literal. String literals must be quote-encapsulated, so that means "string", 'string' or [string] is needed to make the literal. I find the last less subject to a stray delimiter in the string, for example, if you use the single quote, the macro expansion causes an error with the following example:


lcCustName = "Pinhead Ed"
SET FILTER TO custname = '&lcCustName' && seems to work
lcCustName = "O'Malley"
SET FILTER TO custname = '&lcCustName' && whut did it dew?

I hate to use your favorite FLA, but RTFM and look at what goes on in string expressions, literals, and macro-expansion.

Numbers are not quote-encapsulated as literals. Macro-expansion requires a string to be specified for expansion.
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