unit Ufaecher;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls, ExtCtrls;

type
  TForm1 = class(TForm)
    PaintBox1: TPaintBox;
    Zeichne: TButton;
    Neu: TButton;
    Ende: TButton;
    procedure NeuClick(Sender: TObject);
    procedure EndeClick(Sender: TObject);
    procedure ZeichneClick(Sender: TObject);
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}
procedure pause(zeit:integer);    {Deklaration der Prozedur "pause"}
var anfang:integer;
begin
anfang:= gettickcount;
while anfang+zeit > gettickcount do
application.processmessages;
end;

procedure TForm1.NeuClick(Sender: TObject);
var i:integer;
begin
refresh;
with Paintbox1.canvas do
     begin
     for i:= 0 to 128 do begin
     moveto(320,0);
     lineto(5*i,480);
     pause (50);
     end;
     end;
end;

procedure TForm1.EndeClick(Sender: TObject);
begin
close;
end;

procedure TForm1.ZeichneClick(Sender: TObject);
var i:integer;
begin
with Paintbox1.canvas do
     begin
     for i:= 0 to 128 do begin
     moveto(320,0);
     lineto(5*i,480);
     pause (50);
     end;
     end;
end;

end.
