unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ComCtrls;
type
TForm1 =
class(TForm)
Edit1: TEdit;
Edit2: TEdit;
Label1: TLabel;
Label2: TLabel;
Button1: TButton;
ListView1: TListView;
procedure Button1Click(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
type woerterbuch =
record
de:
array[1..5]
of string[25];
en:
array[1..5]
of string[25];
end;
vokabellist =
record
de:
array[1..5]
of string[25];
en:
array[1..5]
of string[25];
gewesen : boolean;
klasse : word;
end;
var
Form1 : TForm1;
l : TListItem;
data : woerterbuch;
woerter :
file of woerterbuch;
vlist :
file of vokabellist;
loades :
record
eng,deu :
string;
de :
array[1..5]
of string[25];
en :
array[1..5]
of string[25];
gewesen : boolean;
klasse : word;
end;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var i:integer;
ltempe,ltempd:
string;
begin
for i:=1
to 5
do
begin
if (pos(edit1.Text,'
,'))>0
then
begin
loades.de[i]:=copy(edit1.Text,0,pos(edit1.Text,'
,')-1);
ltempe:=edit1.Text;
delete(ltempd,0,pos(edit1.Text,'
,')+1);
edit1.Text:=ltempd;
end else
loades.de[i]:=copy(edit1.Text,0,length(edit1.Text));
end;
for i:=1
to 5
do
begin
if (pos(edit2.Text,'
,'))>0
then
begin
loades.en[i]:=copy(edit2.Text,0,pos(edit2.Text,'
,')-1);
ltempe:=edit2.Text;
delete(ltempe,0,pos(edit2.Text,'
,')+1);
edit2.Text:=ltempe;
end else
loades.en[i]:=copy(edit2.Text,0,length(edit2.Text));
end;
assignFile(woerter,'
Datenbank.rec');
reset(woerter);
if FileExists('
Datenbank.rec')
then ReSet(woerter)
else ReWrite(woerter);
for i:=1
to 5
do
begin
data.de[i]:=loades.de[i];
data.en[i]:=loades.en[i];
write(woerter,data);
end;
closefile(woerter);
with listview1.items.add
do
begin
l.Caption:=ltempd;
l.SubItems.Add(ltempe);
end;
end;
end.