I like modular programming, and PE6 make now it easier on PIXAXE, i can #include the modules i want.
Macros are also a long wanted addition.
To automate things i would like the modules I include to add themselves to callers.
My idea is that the caller code is a macro ending with an on-goto statement, and each module add its entry point to it.
I use the functionality that a macro definition can contain another macro:
First i define a macro
#macro taskcaller
on taskptr goto _
#endm
and in each includefile i then have
#macro taskcaller
taskcaller
ppp_includefilename _
#endm
ppp_includefilename:
<code>
goto mainloop
BUT: Currently this fail as macros cannot be redefined.
I would like macros to become redefineable (throw out a warning, but not error)
Have it work to then use a ormer version of same name macro inside the new macro definition.
Alternatively, maybe more easy to implement in PE:
I can make a copy of the original macro under new name, undefine the original, then make a new under original name containing the copy plus additions, then delete the copy:
#macro tempmacro
taskcaller
#endm
#undefmacro taskcaller
#macro taskcaller
tempmacro
ppp_includefilename _
#endm
#undefmacro tempmacro
ppp_includefilename:
<code>
goto mainloop
Macros are also a long wanted addition.
To automate things i would like the modules I include to add themselves to callers.
My idea is that the caller code is a macro ending with an on-goto statement, and each module add its entry point to it.
I use the functionality that a macro definition can contain another macro:
First i define a macro
#macro taskcaller
on taskptr goto _
#endm
and in each includefile i then have
#macro taskcaller
taskcaller
ppp_includefilename _
#endm
ppp_includefilename:
<code>
goto mainloop
BUT: Currently this fail as macros cannot be redefined.
I would like macros to become redefineable (throw out a warning, but not error)
Have it work to then use a ormer version of same name macro inside the new macro definition.
Alternatively, maybe more easy to implement in PE:
I can make a copy of the original macro under new name, undefine the original, then make a new under original name containing the copy plus additions, then delete the copy:
#macro tempmacro
taskcaller
#endm
#undefmacro taskcaller
#macro taskcaller
tempmacro
ppp_includefilename _
#endm
#undefmacro tempmacro
ppp_includefilename:
<code>
goto mainloop