unit UnitMap;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, ExtCtrls;
type
TForm1 =
class(TForm)
GroupBox1: TGroupBox;
Image1: TImage;
Button1: TButton;
ButtonSave: TButton;
ButtonLoad: TButton;
ButtonAdd: TButton;
ButtonDelete: TButton;
ButtonQuit: TButton;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
Label7: TLabel;
Label8: TLabel;
Label9: TLabel;
Label10: TLabel;
Label11: TLabel;
EditName: TEdit;
EditParty: TEdit;
EditKO: TEdit;
EditKK: TEdit;
EditTP: TEdit;
EditINI: TEdit;
EditAT: TEdit;
EditPA: TEdit;
EditWaffe: TEdit;
EditGS: TEdit;
EditLeP: TEdit;
Button2: TButton;
procedure ButtonQuitClick(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure ButtonAddClick(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
type TActor =
class
public
Name:
String;
Index:Integer;
Party:
String;
KO:Integer;
KK:Integer;
LeP, INI, AT, PA, GS:Integer;
Waffe,
TP:
String;
end;
type TDatensatz =
record
Map:
String[40];
Actors:TActor;
end;
var
Form1: TForm1;
FActors:
Array[1..40]
of TActor;
Index:Integer;
implementation
uses UnitAdd;
{$R *.DFM}
procedure TForm1.ButtonQuitClick(Sender: TObject);
begin
exit;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
if Button1.Caption='
+'
then
begin
Button1.Caption:='
-';
ButtonSave.visible:=true;
ButtonLoad.visible:=true;
ButtonAdd.visible:=true;
ButtonDelete.visible:=true;
ButtonQuit.visible:=true;
end
else
begin
Button1.Caption:='
+';
ButtonSave.visible:=false;
ButtonLoad.visible:=false;
ButtonAdd.visible:=false;
ButtonDelete.visible:=false;
ButtonQuit.visible:=false;
end;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
index:=0;
end;
procedure TForm1.ButtonAddClick(Sender: TObject);
begin
Form1.Width:=Form1.Width+100;
end;
function IsNumeric(s:
String):Boolean;
var i:Integer;
begin
Result:=False;
for i := 1
to Length(s)
do
if not (s[i]
in ['
0'..'
9'])
then showmessage('
Ungültige Zeichen!!')
else Result:=True;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
index:=1;
// with FActors[index] do
begin
FActors[
index].
Name:=EditName.text;
FActors[
index].Party:=EditParty.text;
if IsNumeric(EditParty.text)=true
then FActors[
index].KO:=StrToInt(EditKO.text);
if IsNumeric(EditKK.text)=true
then FActors[
index].KK:=StrToInt(EditKK.text);
FActors[
index].TP:=EditTP.text;
if IsNumeric(EditINI.text)=true
then FActors[
index].INI:=StrToInt(EditINI.text);
if IsNumeric(EditAT.text)=true
then FActors[
index].AT:=StrToInt(EditAT.text);
If IsNumeric(EditPA.text)=true
then FActors[
index].PA:=StrToInt(EditPA.text);
FActors[
index].Waffe:=EditWaffe.text;
if IsNumeric(EditGS.text)=true
then FActors[
index].GS:=StrToInt(EditGS.text);
if IsNumeric(EditLeP.text)=true
then FActors[
index].LeP:=StrToInt(EditLeP.text);
end;
end;
end.