Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Use of macro substitution vs. string valued variables
Message
De
22/07/1999 11:35:07
 
 
À
22/07/1999 02:19:38
Dragan Nedeljkovich
Now officially retired
Zrenjanin, Serbia
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00244254
Message ID:
00244768
Vues:
24
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform