Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Why does this work?
Message
From
21/09/2000 12:56:46
 
 
To
21/09/2000 12:43:38
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00419138
Message ID:
00419149
Views:
24
>I have been looking through some code and have found the following:
>
>m.lookup = [ text text text ]
>
>When I tried this, it seems that it has made it a text variable.
>
>I have looked on MSDN library for some documentation on this, since I have never seen this, and could not find anything.
>
>Could anyone point me to documentation for this or explain when and why you would use the above?
>

VFP offers the option of encapsulating strings in three ways - using single quotes - ' text text text ', double quotes - " text text text " or matched pairs of square brackets - [ text text text ]

The reason you'd choose one over the other is ease of use - if you wanted to place the phrase Ed's new book "How to confuse FoxPro" in a single string, and you didn't have the option of using square braces, you'd have to split up the string. You can do:

cMyString = [Ed's new book "How to confuse FoxPro"]

or

cMyString = "Ed's new book " + '"How to confuse FoxPro"'

to avoid having the parser misinterpret the string. It's a matter of flexibility, and has been a standard for Fox and other dBASE-derived languages for as long as I can remember.
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