Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Method Code in a Table Row/Record?
Message
De
10/05/2000 21:51:55
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00368358
Message ID:
00368395
Vues:
19
>I was thinking it would be fairly cool to keep code for some methods in a memo field in a table. Then I could change/debug without re-compiling everything.
>
>Has anyone done this before? Can it be done? How would I execute the code once it was in the field (eval())?
>
>Thanks.

You can't EVAL() more than a single expression. And you can't macro substitute more than a single command. Before SP3, the way to run a block of code from a memo or built dynamically was with Randy Pearson's masterful CodeBlock program. It tooks a block of code, and macro substituted it line by line, even with intelligent branching, loops and cases.

But with VFP SP3, we have COMPILE at runtime. You can pull a block of code from a memo field, write it to a file, COMPILE the file, and DO the program:

=STRTOFILE(MyTable.MyMemo, "Somefile.prg")
COMPILE Somefile.prg
DO SomeFile
Erik Moore
Clientelligence
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform