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 13:30:24
 
 
À
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:
00244860
Vues:
17
>One useful thing for the macros I found was for calling a procedure whose name is in a table, or calculated somehow - like when I calculated interest using several methods, and calling calc01, calc02, calc03 routines, and, you may guess, the table contained "01", "03" and such in the UseMethod field. Then I calculated the factor like this:
>
>lcMeth=table.UseMethod
>lnCoeff=calc&lcMeth()
>
>Of course, I had to make damn sure there were no impossible values in the UseMethod field.
>
>HTH

You still don't need macros to do this- you can use EVAL instead.

lcMeth= "calc." + ALLTRIM(table.UseMethod) + "()"
>lnCoeff=EVAL(lcMeth)

Faster, and IMHO, better.
Erik Moore
Clientelligence
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform