unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Label1: TLabel;
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
num{, add} : Integer;
begin
num := 0;
Repeat
//1
num := num +1;
Label1.Caption := IntToStr(num);
Sleep(1000);
Application.ProcessMessages;
//2
num := num +1;
Label1.Caption := IntToStr(num);
Sleep(1000);
Application.ProcessMessages;
//3
num := num +1;
Label1.Caption := IntToStr(num);
Sleep(1000);
Application.ProcessMessages;
//4
num := num +1;
Label1.Caption := IntToStr(num);
Sleep(1000);
Application.ProcessMessages;
//5
num := num +1;
Label1.Caption := IntToStr(num);
Sleep(1000);
Application.ProcessMessages;
//6
num := num +1;
Label1.Caption := IntToStr(num);
Sleep(1000);
Application.ProcessMessages;
//7
num := num +1;
Label1.Caption := IntToStr(num);
Sleep(1000);
Application.ProcessMessages;
//8
num := num +1;
Label1.Caption := IntToStr(num);
Sleep(1000);
Application.ProcessMessages;
//9
num := num +1;
Label1.Caption := IntToStr(num);
Sleep(1000);
Application.ProcessMessages;
//10
num := num +1;
Label1.Caption := IntToStr(num);
Sleep(1000);
Application.ProcessMessages;
until num = 10;
end;
end.
I am well pleased!
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Label1: TLabel;
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
num{, add} : Integer;
begin
num := 0;
Repeat
//1
num := num +1;
Label1.Caption := IntToStr(num);
Sleep(1000);
Application.ProcessMessages;
//2
num := num +1;
Label1.Caption := IntToStr(num);
Sleep(1000);
Application.ProcessMessages;
//3
num := num +1;
Label1.Caption := IntToStr(num);
Sleep(1000);
Application.ProcessMessages;
//4
num := num +1;
Label1.Caption := IntToStr(num);
Sleep(1000);
Application.ProcessMessages;
//5
num := num +1;
Label1.Caption := IntToStr(num);
Sleep(1000);
Application.ProcessMessages;
//6
num := num +1;
Label1.Caption := IntToStr(num);
Sleep(1000);
Application.ProcessMessages;
//7
num := num +1;
Label1.Caption := IntToStr(num);
Sleep(1000);
Application.ProcessMessages;
//8
num := num +1;
Label1.Caption := IntToStr(num);
Sleep(1000);
Application.ProcessMessages;
//9
num := num +1;
Label1.Caption := IntToStr(num);
Sleep(1000);
Application.ProcessMessages;
//10
num := num +1;
Label1.Caption := IntToStr(num);
Sleep(1000);
Application.ProcessMessages;
until num = 10;
end;
end.
I am well pleased!