[Implemented] Defined() for Procedures
Posted: Sat Feb 04, 2006 6:46 pm
I would like to have Defined() for procedures because we could do things
like:
Also something like the requested keyword LOOP X that works like a macro
and inserts the code X times. Temp constants would be nice too! Or just
make constants undefinable (so we could make our own 'local' constants).
Perhaps also (all) the other keywords like 'For' to work at compile time:
Just some wishes 
like:
Code: Select all
Macro createVT(name, p1=0, p2=0, p3=0, p4=0, p5=0, p6=0, p7=0, p8=0, p9=0, p10=0)
DataSection
name#_VTable:
Data.l ?name#_Procedures
name#_Procedures:
CompilerIf Defined(p1, #PB_Procedure)
Data.l ?p1
CompilerIf Defined(p2, #PB_Procedure)
Data.l ?p2
CompilerEndIf
; ...
CompilerEndIf
EndDataSection
EndMacro
createVT(iTEST, test_SetX(), test_SetY())
and inserts the code X times. Temp constants would be nice too! Or just
make constants undefinable (so we could make our own 'local' constants).
Perhaps also (all) the other keywords like 'For' to work at compile time:
Code: Select all
Macro doit(from, till)
Define(#x)
For #x = from To till
Data.l #x * 5 + 1
Next
undefine(#x)
EndMacro
doit(2, 5)
