Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Running Code Dynamically
Message
De
26/07/1997 01:41:45
Bob Lucas
The WordWare Agency
Alberta, Canada
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00041271
Message ID:
00041779
Vues:
33
>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
Fil
Voir

Click here to load this message in the networking platform