unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, Buttons;
type
TForm1 =
class(TForm)
Edit1: TEdit;
Edit2: TEdit;
Edit3: TEdit;
Edit4: TEdit;
Edit5: TEdit;
Edit6: TEdit;
Edit7: TEdit;
Edit8: TEdit;
Edit9: TEdit;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
Label7: TLabel;
Label8: TLabel;
Label9: TLabel;
Label10: TLabel;
Label11: TLabel;
Button1: TButton;
Button2: TButton;
Button3: TButton;
ListBox1: TListBox;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
type
Personendatenbank=
Record
Vorname :
string;
Nachname :
string;
Strasse:
string;
Hn:
string;
PLZ:
string;
Ort:
string;
Tel1:
string;
Tel2:
string;
end;
var
Form1: TForm1;
Name:
String; gast:
Array [1..50]
of Personendatenbank;
Personendatei: Personendatenbank;
implementation
{$R *.DFM}
procedure TForm1.Button1Click(Sender: TObject);
var n,
index, index2: Integer;
begin
n:=StrToInt(Edit2.Text);
ListBox1.Clear;
gast[StrToInt(Edit2.Text)] .Vorname := (Edit1.Text);
gast[StrToInt(Edit2.Text)] .Nachname := (Edit7.Text);
gast[StrToInt(Edit2.Text)] .Strasse := (Edit3.Text);
gast[StrToInt(Edit2.Text)] .Hn:= (Edit4.Text);
gast[StrToInt(Edit2.Text)] .PLZ := (Edit5.Text);
gast[StrToInt(Edit2.Text)] .Ort := (Edit6.Text);
gast[StrToInt(Edit2.Text)] .Tel1 := (Edit8.Text);
gast[StrToInt(Edit2.Text)] .Tel2 := (Edit9.Text);
for index:= 1
TO 50
Do
begin
ListBox1.Items.Add(IntToStr(
index)+'
. '+gast[
index] .Vorname + '
--- ' + gast[
index] .Nachname + '
--- ' + gast[
index] .Strasse + '
' + gast[
index] .Hn + '
--- ' + gast[
index] .PLZ + '
--- ' + gast[
index] .Ort + '
--- '+ gast[
index] .Tel1 + '
/ ' + gast[
index] .Tel2 + '
');
end;
n:=n+1;
Edit2.Text:=IntToStr(n);
end;
procedure TForm1.Button2Click(Sender: TObject);
var index: Integer;
begin
ListBox1.Clear;
gast[StrToInt(Edit2.Text)] .Vorname := '
';
gast[StrToInt(Edit2.Text)] .Nachname := '
';
gast[StrToInt(Edit2.Text)] .Strasse := '
';
gast[StrToInt(Edit2.Text)] .Hn:= '
';
gast[StrToInt(Edit2.Text)] .PLZ := '
';
gast[StrToInt(Edit2.Text)] .Ort := '
';
gast[StrToInt(Edit2.Text)] .Tel1 := '
';
gast[StrToInt(Edit2.Text)] .Tel2 := '
';
for index:= 1
TO 50
Do
begin
ListBox1.Items.Add (IntToStr(
index)+'
. '+gast[
index] .Vorname + '
--- ' + gast[
index] .Nachname + '
--- ' + gast[
index] .Strasse + '
--- ' + gast[
index] .Hn + '
--- ' + gast[
index] .PLZ + '
--- ' + gast[
index] .Ort + '
--- ' + gast[
index] .Tel1 + '
/' + gast[
index] .Tel2 + '
' );
end;
end;
procedure TForm1.Button3Click(Sender: TObject);
begin
close;
end;
end.