I've been wondering how to use the variable type "code" in creating a function that can execute a function given to it.
For instance;
Then in another trigger
I know I can store it in a trigger and just execute the trigger, but I was wondering if that was truly the best way. Anyone's thoughts? I can't seem to find anything relating to this.
For instance;
JASS:
globals
code Func
endglobals
function SetFunction takes code codeFunc returns nothing
set Func = codeFunc //I want to use the function later, So I store it in a global.
endfunction
function RunFunction takes nothing returns nothing
//Not sure what to put here.
endfunction
Then in another trigger
JASS:
function This takes nothing returns nothing
//...
endfunction
function That takes nothing returns nothing
call SetFunction(function This)
endfunction
I know I can store it in a trigger and just execute the trigger, but I was wondering if that was truly the best way. Anyone's thoughts? I can't seem to find anything relating to this.