Why we can’t close a form that runs a tight FOR loop, even if we are using Application.ProcessMessages?
A Stack Overflow user wanted to know why clicking on the form’s close button while some FOR loop is running does nothing: procedure TForm1.Button1Click(Sender: TObject); var i: Integer; begin for i := 0 to 9999999 do begin Memo1.Lines.Add(‘hi’); Application.ProcessMessages; end; end; The issue comes from the lack of understanding of how the forms work. Here […]