unit uKlasse;

interface

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

type
  TForm1 = class(TForm)
    Panel1: TPanel;
    Label1: TLabel;
    NameEin: TEdit;
    NaechsterSchueler: TButton;
    Button2: TButton;
    Button3: TButton;
    AusgabeListe: TListBox;
    Neu: TButton;
    procedure Button3Click(Sender: TObject);
    procedure NaechsterSchuelerClick(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure NeuClick(Sender: TObject);
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  Form1: TForm1;
  Schueler : array[1..20] of String[80];
  n :Integer;

implementation

{$R *.DFM}

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

procedure TForm1.NaechsterSchuelerClick(Sender: TObject);
begin
  NameEin.SetFocus;
  n := n +1;
  Schueler[n] := NameEin.Text;
  NameEin.Text :='';
  Label1.caption := 'Eingabe des '+inttostr(n+1)+'. Schülers:';
end;

procedure TForm1.Button2Click(Sender: TObject);
var i,m : integer;
begin
   m := n;
  AusgabeListe.clear;
  for i:=1 to m do
  AusgabeListe.Items.Add(inttostr(i)+'   '+Schueler[i]);

end;

procedure TForm1.NeuClick(Sender: TObject);
begin
  NameEin.Text :='';
  AusgabeListe.Clear;
  n:=0;
  NameEin.SetFocus;
end;

end.
