Global Programs
Hello
I've succesfuly managed to handle by code, appending, modifying or even
delete global objects such as Global Constants, Global Variables as well as
the Global events OnCreate and OnDestroy. Now I would like to do the same
with the last section-group of the Global main section which handles
Programs (Global Procedures and Functions). First I would like to be able to
erase (remove) any or all existed Global Procedures and Functions of a
TppReport. How is that applicable ? Is there any method in the CodeModule
which does that task ? I've seen the CodeModule.GlobalProgramCount and the
CodeModule.GlobalPrograms[Idx] : TraProgram but I cannot find any method
where I may, by code, remove any or all of these. After that I would like to
be able to append (always by code) a new procedure or function. What're the
related methods of CodeModule which I should use ?
--
Best Regards
G.MYTSKIDIS
MYTSKIDIS_G@GI-NET.GR
I've succesfuly managed to handle by code, appending, modifying or even
delete global objects such as Global Constants, Global Variables as well as
the Global events OnCreate and OnDestroy. Now I would like to do the same
with the last section-group of the Global main section which handles
Programs (Global Procedures and Functions). First I would like to be able to
erase (remove) any or all existed Global Procedures and Functions of a
TppReport. How is that applicable ? Is there any method in the CodeModule
which does that task ? I've seen the CodeModule.GlobalProgramCount and the
CodeModule.GlobalPrograms[Idx] : TraProgram but I cannot find any method
where I may, by code, remove any or all of these. After that I would like to
be able to append (always by code) a new procedure or function. What're the
related methods of CodeModule which I should use ?
--
Best Regards
G.MYTSKIDIS
MYTSKIDIS_G@GI-NET.GR
This discussion has been closed.
Comments
You can iterate over the CodeModule.GlobalPrograms list and call
Program.Free. The Program will notify the CodeManager to remove it from the
GlobalPrograms[] list. (So you need to be structure your code to
accordingly).
These two examples show how to programmatically create new global procedures
and variables
www.digital-metaphors.com/tips/CreateGlobalProc.zip
www.digital-metaphors.com/tips/CreateGlobalVar.zip
--
Nard Moseley
Digital Metaphors Corporation
www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com