It would be helpful to have a sort of named macro variables, where some information could be stored, which could be used in other macros:
Example:Syntax:
SetMacroVariable(VarName,Value) ... sets the macro variable "VarName"
GetMacroVariable(VarName) ... will be replaced by Value of "VarName"
Code: Select all
;====================================================
Structure __CLASS__OBJ_BASE
*VTable
*ObjectData
EndStructure
;====================================================
Macro IClass(ClassName)
__#ClassName#__CLASS_INTERFACE
EndMacro
Macro OClass(ClassName)
__#ClassName#__CLASS_OBJECT
EndMacro
Macro Class(ClassName)
SetMacroVariable(ActualClass,ClassName)
Interface IClass(ClassName)
EndMacro
Macro EndClass
EndInterface
Structure OClass(GetMacroVariable(ActualClass)) Extends __CLASS__OBJ_BASE
Functions.l[SizeOf(IClass(GetMacroVariable(ActualClass)))/4]
EndStructure
EndMacro
Macro ExtendClass(ClassName)
Extends IClass(ClassName)
SetMacroVariable(ExtendClass,ClassName)
EndMacro
;====================================================
Class(CLASS_1)
function1()
function2(arg1,arg2)
EndClass
Class(CLASS_2) ExtendClass(CLASS_1)
function4()
function5(arg1,arg2)
function6(arg1)
EndClass
Code: Select all
Class(CLASS_1)
function1()
function2(arg1,arg2)
EndClass(CLASS_1)
Class(CLASS_2) ExtendClass(CLASS_1)
function4()
function5(arg1,arg2)
function6(arg1)
EndClass(CLASS_2)
What do you think about this idea?
cu, helpy