Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Why?
Message
 
 
À
11/01/1999 15:55:12
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Re: Why?
Divers
Thread ID:
00174204
Message ID:
00174869
Vues:
30
>>>And you could probably expand an object reference via &objectname..&propertyname, but again, why, when name expansion is faster and isn't delimiter-sensitive?
>>
>>Well, I didn't say it was fast, just that it was possible. But there are instances where the syntax doesn't call for a name, and so a name expression isn't an option, in which case macro expansion is useful and it's nice to know how to do it.
>
>If that's the case, then EVAL() is an option.

Sure. In the example I originally gave (to display the contents of a field when the table name and field name are variables) one could write
?eval(eval('lcTableName') + '.' + eval('lcFieldName'))
instead of
?&lcTableName..&lcFieldName.
>There are relatively few times where macro expansion is desirtable, and this particular case, it's simply the wrong thing to use.

I think we both agree that a name expression is a better choice in this particular case. Again, I wasn't trying to defend the use of macro expansion so much as I was simply saying that it is syntactically possible to reference a table.fieldname that way.

BTW, Ed, there are a few people whose posts I always read here on UT, and yours are among them. Thanks for the many and various insights along the way.
Rick Borup, MCSD

recursion (rE-kur'-shun) n.
  see recursion.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform