procedure Delay(ms : longint); var TheTime : LongInt; begin TheTime := GetTickCount + ms; while GetTickCount < TheTime do Application.ProcessMessages; end; procedure TForm1.Button1Click(Sender: TObject); var i,s:integer; begin s:=100; for i:=1 to 100 do begin s:=s-1; edit1.Text:=inttostr(s); Delay(1000); end; end; procedure TForm1.Button2Click(Sender: TObject); begin halt; end; procedure TForm1.FormCreate(Sender: TObject); begin edit1.Text:='100'; end;