>Hi there:
>Has anyone tried to generate a PRG and run it dynamically at run-time. I have a table with a memo field with the code I want to execute at run-time. This works under development mode but fails at run-time, since the PRGs I dynamically create are not "burned" in the EXE.
>
>Any ideas?
>
>TIA
>
> Antonio Lozada
My Method is to have two memo fields in the table, one for the source code, and one for the compiled code. (Copy the memo field to temp.prg COMPILE temp.prg and append the object code memo field from temp.fxp.)
At runtime I copy the memo field (object code) to temp.fxp like this:
m.temp = 'temp.fxp'
COPY MEMO objcode TO temp.fxp
DO (m.temp)
I put the program name into a variable so the compiler does not complain about finding temp.fxp. This only works if you can generate and compile the source code. If the source code is dynamic (build on the fly) then you need to use macros or the CODEBLCK. But then it wouldn't need to be in a memo field!
Bob
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement