unit Unit2;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, Grids;
type
TForm2 =
class(TForm)
Button1: TButton;
Edit1: TEdit;
Label1: TLabel;
Edit2: TEdit;
Label2: TLabel;
Edit3: TEdit;
Label3: TLabel;
Edit4: TEdit;
Label4: TLabel;
Edit5: TEdit;
Label5: TLabel;
Edit6: TEdit;
Label6: TLabel;
Edit7: TEdit;
Label7: TLabel;
Edit8: TEdit;
Button2: TButton;
Button3: TButton;
Button4: TButton;
Edit9: TEdit;
Label8: TLabel;
Edit10: TEdit;
Edit11: TEdit;
Edit12: TEdit;
Label9: TLabel;
Button6: TButton;
ComboBox1: TComboBox;
Button5: TButton;
Button7: TButton;
StringGrid1: TStringGrid;
Label10: TLabel;
Edit13: TEdit;
Label11: TLabel;
Edit14: TEdit;
Label12: TLabel;
Edit15: TEdit;
Button8: TButton;
procedure Button1Click(Sender: TObject);
procedure Button6Click(Sender: TObject);
procedure ComboBox1Change(Sender: TObject);
procedure Button5Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button7Click(Sender: TObject);
procedure Edit1Change(Sender: TObject);
procedure Edit2Change(Sender: TObject);
procedure Edit3Change(Sender: TObject);
procedure Edit4Change(Sender: TObject);
procedure Edit5Change(Sender: TObject);
procedure Edit6Change(Sender: TObject);
procedure Edit9Change(Sender: TObject);
procedure Edit10Change(Sender: TObject);
procedure Edit11Change(Sender: TObject);
procedure Edit12Change(Sender: TObject);
procedure Edit13Change(Sender: TObject);
procedure Edit14Change(Sender: TObject);
procedure Edit15Change(Sender: TObject);
procedure Edit8Change(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form2: TForm2;
{ Beginn der abzuspeichernden Datei}
namen :
array[1..9999]
of string[40];
Vorname :
array[1..9999]
of string[40];
Strasse :
array[1..9999]
of string[40];
plz :
array[1..9999]
of string[8];
ort :
array[1..9999]
of string[40];
kundenstatus1 :
array[1..9999]
of string[20];
kundenstatus2 :
array[1..9999]
of string[20];
Geburtstag :
array[1..9999]
of string[10];
Kundennummer :
array[1..9999]
of string[12];
memo :
array[1..9999]
of string;
handy :
array[1..9999]
of string[20];
tel :
array[1..9999]
of string[20];
email :
array[1..9999]
of string[30];
belegt :
array[1..9999]
of boolean;
Sortkriterium : integer;
nummer : integer;
{ ende der abzuspeichernden datei}
sortfeld :
array[1..10]
of string;
puffername :
string;
x : integer;
{laufende Variablen}
const
dateigefunden : boolean=false;
implementation
uses unit1;
{$R *.DFM}
procedure gitterdefinieren;
begin
with form2.stringgrid1
do begin Hier bekomme ich den fehler
colwidths[0]:=130;
colwidths[1]:=90;
colwidths[2]:=130;
colwidths[3]:=40;
colwidths[4]:=130;
colwidths[5]:=50;
colwidths[6]:=50;
colwidths[7]:=70;
colwidths[8]:=90;
colwidths[9]:=90;
colwidths[10]:=140;
cells[0,0]:='
Name';
cells[1,0]:='
Vorname';
cells[2,0]:='
Strasse';
cells[3,0]:='
Plz';
cells[4,0]:='
Ort';
cells[5,0]:='
KdSta1';
cells[6,0]:='
KdSta2';
cells[7,0]:='
Geburtsdatum';
cells[8,0]:='
Handy';
cells[9,0]:='
Tel.Nr';
cells[10,0]:='
Email';
end;
end;
procedure sortieren;
var
i : integer;
begin
gitterdefinieren;
WirklichSortieren;
for i:=1
to nummer
do begin
with form2.stringgrid1
do begin
cells[0,i]:=namen[i];
cells[1,i]:=vorname[i];
cells[2,i]:=strasse[i];
cells[3,i]:=plz[i];
cells[4,i]:=ort[i];
cells[5,i]:=kundenstatus1[i];
cells[6,i]:=kundenstatus2[i];
cells[7,i]:=geburtstag[i];
cells[8,i]:=handy[i];
cells[9,i]:=tel[i];
cells[10,i]:=email[i];
end;
end;
end;
begin
sortfeld[1]:='
Name';
sortfeld[2]:='
Vorname';
sortfeld[3]:='
Strasse';
sortfeld[4]:='
Plz';
sortfeld[5]:='
Ort';
sortfeld[6]:='
Kundenstatus1';
sortfeld[7]:='
Kundenstatus2';
sortfeld[8]:='
Geburtstag';
sortfeld[9]:='
jüngste Kunden';
sortfeld[10]:='
älteste Kunden';
for x:=1
to 9999
do belegt[x]:=false;
pruefdateiladen;
if dateigefunden=true
then dateiladen;
sortkriterium:=0;
sortieren;
end.