Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Program code in a memo file
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00410133
Message ID:
00410247
Views:
16
>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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform