I have a thread that executes an action and onterminate executes a secondary procedure.
It works like this:
procedure qualquer;
var
Thread: TThread;
begin
Thread.CreateAnonymousThread(
procedure()
begin
excecuta ação
end;
//como quero que fique - adicionando parametros
Thread.OnTerminate:= concluiacao(parametro sender, outro parametro);
//como faço
Thread.OnTerminate:= concluiacao;
Thread.Start;
end;
Then I execute the second procedure
procedure concluiacao(Sender: TObject);
begin
if TThread(Sender).FatalException <> nil then
begin
ShowMessage(TThread(Sender).FatalException.ToString);
Exit;
end
else
continua os processos normalmente;
end;
I would like to send new parameters in the onterminate of the thread, but the first parameter is a sender, and I do not know how to send it.