Woow-wow-wow, now I have few possibilities to pass params:
timer.performWithDelay(5000, function()
test(123)
end)
local val = test(123)
timer.performWithDelay(5000, val) – if val is a ref to a function to be called, this is fine
timer.performWithDelay(5000, test2 )
local function onTimer( event )
local params = event.source.params
print( params.myParam1 )
print( params.myParam2 )
end
local tm = timer.performWithDelay( 1000, onTimer )
tm.params = { myParam1 = “Parameter1”, myParam2 = “Parameter2” }
Thank you guys!
This piece «local val = test(123) »
will not work. This will simply execute test func instead of making a ref, isn’t so?
THIS STRANGE LUA LANGUAGE!!! It breaks all programming rules… no, not rules, oh here are these words: stereotypes and and programming habbits. Damn, I can be stuck in few lines of simplest code. Once upon a time I will find them divine, but now this is strange to me )))