Event Return or Delay in Function?

My aim is to run either an Event that can return a variable, or have a Function (which can) with a delay. Either way, the purpose is to know when my task has finished like a function does.

Any suggestions?

Functions cannot have latent events.

What you’re looking for is called a Macro.

What is the “task” here? Usually this is a case to use delegates which you can broadcast when a task is finished, instead of checking state after delay, if that is what you are trying to do.

Another way, closer to a “delay” is to run a timer from a function:


@Roy_Wierer.Seda145 is right. Your problem sounds like a Dispatcher situation.

Dig right there…you just bind some ‘i’m finished’ dispatcher to a function and when you actually finish you call it and everybody that is binded will hear and know what to do

Thanks for the suggestions.