John Baird
Coatesville, Pennsylvanie, États-Unis
Information générale
Catégorie:
Codage, syntaxe et commandes
>Yep. It's called misuse of macro-expansion. Macro-expansion is neither needed nor desirable where you are simply using it to expand a name - you're giving VFP's interpreter the opprtunity to miscue early and often. Instead of using the macro-expansion operation, use name resolution by encapsulating theings that are names within parentheses - VFP can't misparse the name this way due to embedded delimiters, and it's faster and more reliable as well.
>
>Jim Booth's thread on the 10 most misused VFP constructs was right on the money - misuse of macro expansion is one of the worst culprits, and results in more head-scratching than almost any other part of the language, because programmers make poor assumptions about what;'s actually happening when macro-expansion takes place. If you need to get the command line parser involved in runtime interpretation of the command as a whole, then macro-expansion may be warranted; using it to replace a name at runtime means you've taken the lazy approach to handling the problem without regard for what is needed or desirable.
>
I hope you didn't mean these comments to be as condescending as they sound. I'm netiher lazy nor a poor programmer. I may not have understood the differences between name expression and macro-expansion as well as you, but I thank you for clarifying the problem.
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement