Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Use of macro substitution vs. string valued variables
Message
From
22/07/1999 11:35:07
 
 
To
22/07/1999 02:19:38
Dragan Nedeljkovich
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00244254
Message ID:
00244768
Views:
18
>You may still USE "&cName" - the quotes will do it.

I tried this and it works....which I find a little incredible.

Usually, quotes are the sacred gardians of literal, not to be interpreted by any man or beast, text. Here we have an operator interpreted inside of quotes.

What's really amazing is that if cName is undefined, the result of ?"&cNAME" is the literal string &cName whereas if cName is a string valued variable set to "ON", ?"&cName" produces ON.

There doesn't seem to be a mechanism for preventing "&cName" from being expanded as a macro if cName is defined and contains a string. Ambiguous code is possible.

Seems like an ill-designed feature to me.
"The Iron Fish: The water is cold...but the fish don't mind"
...Jay Jenks, boyhood chum
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform