A quick question about ExecuteFunc(), I don't have a computer with WC3 to test this
Does ExecuteFunction() start a new thread?
If I call it in a loop, will the loop continue as the function continues?
(If you know the answer, skip the example and just answer yes or no)
I hope to god it does not start a new thread, because this would cause all kinds of chaos and problems
This example is obviously a nonsensical example, but it is pretty clear I won't get the effects I am looking for if there is a new thread, and the x variable gets changed to numbers that it is not supposed to be
Does ExecuteFunction() start a new thread?
If I call it in a loop, will the loop continue as the function continues?
(If you know the answer, skip the example and just answer yes or no)
JASS:
globals
integer GlobalX
endglobals
function ExampleFunction takes nothing returns nothing
set GlobalX = 8
endfunction
function Loop takes nothing returns nothing
local integer i = 0
local integer x = 0
loop
exitwhen i == 25 //Loops end doesn't really matter
call ExcuteFunc("ExampleFunction")
set x = GlobalX
if x == 8 then
set i = 25
endif
set x = x + 1
set i = i + 1
endloop
endfunction
I hope to god it does not start a new thread, because this would cause all kinds of chaos and problems
This example is obviously a nonsensical example, but it is pretty clear I won't get the effects I am looking for if there is a new thread, and the x variable gets changed to numbers that it is not supposed to be