Sonjli 6 Posted October 18, 2021 Hello, I don't know how I can pass an anonymous function inside a omniTask. Example: type TMyObject = class [...] end; TMyFunction = reference to function(const Arg1: string): TMyObject; var lFunc: TMyFunction; procedure Something; begin lFunc := function(const Arg1: string): TMyObject begin result := TMyObject.Create(Arg1); end; CreateTask( procedure(Task: IOmniTask) var lthdFunc: TMyFunction; lResult: TMyObject; begin lthdFunc := Task.Params['MyRefFunction'].As???; // <-- What here? lResult := lthdFunc('dummy'); [...] end ) .SetParameter('MyRefFunction', lFunc) .Run; end; Thanks in advance, Eddy. Share this post Link to post