Page 1 of 1

Calling Macros in Macros

Posted: Thu Jul 02, 2009 2:29 pm
by cxAlex

Code: Select all

Macro DO_1()
  x=1
EndMacro

Macro DO_2()
  x=2
EndMacro

Macro DO(x)
  DO_#x()
EndMacro

Do(1)
Please add a possibility to call macros in macros.

Greets, Alex

Posted: Thu Jul 02, 2009 2:50 pm
by Kaeru Gaman
wouldn't that need Two-Pass-Compiling...?

Posted: Thu Jul 02, 2009 2:52 pm
by Thalius
Not if you pass em in the right Order .. kind of like Procedures without the declare.

However while i dont see the benefit from this except a few calls instead using a procedure - i cant really say if this makes sense to implement or not . Since it probably would mean reworking the macro system quiet a bit.

Cheers,
Thalius

Posted: Thu Jul 02, 2009 4:24 pm
by Trond

Code: Select all

Macro DO_1() 
  x=1 
EndMacro 

Macro DO_2() 
  x=2 
EndMacro 

Macro CallMacro(N)
  N
EndMacro

Macro DO(x)
  CallMacro(DO_#x())
EndMacro

Do(1)
Debug x


Posted: Thu Jul 02, 2009 5:14 pm
by Thalius
okay.. but you could almost make a new style of coding out of that. :lol: