thread

Using Threads in Delphi

This is an easy way to work with threads in Delphi. Just make sure to use synchronize properly 🙂 Function Details uses System.Classes, System.SysUtils, Vcl.Forms; procedure Wait(Proc: TProc); begin Thread := TThread.CreateAnonymousThread(procedure() begin Proc; end); Thread.FreeOnTerminate := True; Thread.Start; while not Thread.Finished do Application.ProcessMessages; end; How to Use Wait(procedure() begin // .... content end);