| 08-01-2008, 04:25 PM | #1 |
Is it possible? It gives me syntax errors. |
| 08-01-2008, 04:28 PM | #2 |
It's possible. Can we see the macros? |
| 08-01-2008, 04:38 PM | #3 |
JASS:function test1 takes nothing returns nothing call BJDebugMsg("1") endfunction function test2 takes nothing returns nothing call BJDebugMsg("2") endfunction //! textmacro testmacro takes FUNC, INSTANCE function whenrunned$INSTANCE$ takes nothing returns nothing call $FUNC$ endfunction //! endtextmacro function runtext takes nothing returns nothing //! runtextmacro testmacro("test1", "1") //! runtextmacro testmacro("test1", "2") endfunction function InitTrig takes nothing returns nothing local trigger t = CreateTrigger() call TriggerAddAction(t, function runtext) endfunction |
| 08-01-2008, 04:42 PM | #4 |
You can't have a function in a function. This is what you want I think: JASS://! textmacro testmacro takes FUNC call $FUNC$() //! endtextmacro |
| 08-01-2008, 04:45 PM | #5 |
The problem in this case is, that you write a function inside a function ... The entire thing should be JASS:function test1 takes nothing returns nothing call BJDebugMsg("1") endfunction function test2 takes nothing returns nothing call BJDebugMsg("2") endfunction //! textmacro testmacro takes FUNC, INSTANCE call $FUNC$() //! endtextmacro function runtext takes nothing returns nothing //! runtextmacro testmacro("test1", "1") //! runtextmacro testmacro("test1", "2") endfunction function InitTrig takes nothing returns nothing local trigger t = CreateTrigger() call TriggerAddAction(t, function runtext) endfunction ---Edit--- Darn, Alexander was faster ... |
