Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Program code in a memo file
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00410133
Message ID:
00410247
Vues:
15
>Greetings All,
>
>I had a student recently ask me if you can store code in a memo field so it can be accessed, compiled, and executed at runtime. I think this is possible with the COMPILE command, yes? I just haven't had a chance to research it yet...
>
>So, is it fairly striaght forward? Any traps I should tell him to watch out for?
>
>Thanks!

Yep. Do it all the time - without the COMPILE command

** e.g.,code in field mcode
lcFile = FORCEEXT(FORCEPATH(SYS(2015),SYS(2023)),"PRG")
COPY MEMO mcode TO (lcFile)
* make sure it got out there...
IF FILE(lcFile)
DO (lcFile)
ENDIF
** clean up
ERASE (FORCEEXT(lcFile,"*"))
Insanity: Doing the same thing over and over and expecting different results.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform