unit Ufaecher;

interface

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

type
  TForm1 = class(TForm)
    PaintBox1: TPaintBox;
    Zeichne: TButton;
    Ende: TButton;
    Label1: TLabel;
    Edit1: TEdit;
    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);

begin

Paintbox1.canvas.refresh;
end;

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

procedure TForm1.ZeichneClick(Sender: TObject);
var i,x:integer;
begin
refresh;
i:=1;
if edit1.text='' then x:=0 else
x:=strtoint(edit1.text);
with Paintbox1.canvas do
     begin
     while x+i < 640 do
           begin
           i:=i+x;
           moveto(320,0);
           lineto(i,480);
           pause (10);
           end;
     end;
end;

end.
