Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Dynamic Procedures
Message
From
07/08/2002 14:36:29
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00687124
Message ID:
00687186
Views:
15
Thank you very much.

>Runtime cannot compile PRG automaticly.You've to do that using COMPILE command.
COMPILE (m.newfile)
>set procedure to (m.newfile + ".fxp")
>
>>I have created a program that creates another program file with procedures defined within, then sets procedure to the just created program, and excutes the procedures just created. This works fine as long as the first file is not built into an exe. If running as an exe I am not able to set procedure to the newly created file, I assume because it is not part of the exe and the exe is not going to look outside itself for components. I could do this with objects but I don't know how to create an object and add methods to it on the fly.
>>
>>for example:
>>
>>myprog.prg
>>
>>newfile = 'abc.prg'
>>strtofile('procedure myprocedure'+chr(10),newfile,.T.)
>>strtofile('? "hello"'+chr(10),newfile,.T.)
>>strtofile('endproc'+chr(10),newfile,.T.)
>>
>>set procedure to &newfile &&This causes a file not found error
>>
>>myprocedure()
>>
>>TIA
>>Robert
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform