procedure TForm1.Edit1Change(Sender: TObject); begin try if StrToInt(Edit1.Text) <= 0 then Application.Terminate; except Application.Terminate; end; end;