Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Use of macro substitution vs. string valued variables
Message
From
25/07/1999 02:17:02
David Fluker
NGIT - Centers For Disease Control
Decatur, Georgia, United States
 
 
To
24/07/1999 18:15:24
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00244254
Message ID:
00245810
Views:
19
>>SET COLLATE TO coldcollate works because coldcollate is the name of a variable which contains a string argument that SET COLLATE TO accepts. I bet all of the following will work!
>>
>>collate = set("collate")
>
>This shouldn't work, because the Set Collate command requires a string; when the macro unpacks you get a word without quotes
>>SET COLLATE TO &collate
>...so this should work:
>>SET COLLATE to collate
>...because it really gets a string (string variable in this case). We could also
>SET COLLATE to (collate)
>...since this will yield a value of a string variable, which is a string expression.
>
>The whole, ahem. set of SET statements reminds me of a big house with lots of rooms which were added later, so they all have doors and light, but you find very different doorknobs, lightswitches and lights, whichever was available (fashionable) at the time they were added. One thing that always annoyed me in xBase is that you didn't need quotes around all of the strings - the alias names, filenames, etc. Now we're gone into another direction: you must put quotes around things which are actually variables or filenames, like when you're assigning a ControlSource property. It's as consistent as if politicians designed it... but I still like it (in general).

Your "adding on to the house analogy" is great! There have been many "rooms" added to FoxPro since it came out in 1989. But it has made quite a house!
David.
Previous
Reply
Map
View

Click here to load this message in the networking platform