Imp.wakeup(float, function) - how to pass argument?


New to imp. I would like to call a function with argument some time later. So I set the delay time, and call the function using

imp.wakeup(delayTime, myFunction);

Now myFunction take 1 parameter. How do I pass the function argument?

You can call a function with one (or more) parameters by using an lambda (inline) function in imp.wakeup:

imp.wakeup(delayTime, function() { myFunction(myParam); });

That works.