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
de1,de2,de3,de4,de5,de,en1,en2,en3,en4,en5,en:
string[25];
end;
vokabellist =
record
de1,de2,de3,de4,de5,de,en1,en2,en3,en4,en5,en:
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
if (edit1.text<>'
')
or (edit2.text<>'
')
then
begin
if (pos(edit1.Text,'
,'))>0
then
begin
for i:=1
to 5
do
begin
loades.de[i]:=copy(edit1.Text,0,pos(edit1.Text,'
,')-1);
ltempd:=edit1.Text;
delete(ltempd,0,pos(edit1.Text,'
,')+1);
edit1.Text:=ltempd;
showmessage('
ltempd: '+ltempd);
end;
if pos(edit1.Text,'
,')=0
then
begin
ltempd:=edit1.Text;
loades.de[1]:=copy(edit1.Text,0,length(edit1.Text));
loades.de[2]:='
';
loades.de[2]:='
';
loades.de[3]:='
';
loades.de[4]:='
';
end;
end;
if (pos(edit2.Text,'
,'))>0
then
begin
for i:=1
to 5
do
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;
if pos(edit2.Text,'
,')=0
then
begin
ltempe:=edit2.Text;
loades.en[1]:=copy(edit2.Text,0,length(edit2.Text));
loades.en[2]:='
';
loades.en[2]:='
';
loades.en[3]:='
';
loades.en[4]:='
';
end;
end;
assignFile(woerter,'
Datenbank.rec');
if FileExists('
Datenbank.rec')
then ReSet(woerter)
else ReWrite(woerter);
begin
data.de:=ltempd;
data.de1:=loades.de[1];
data.de2:=loades.de[2];
data.de3:=loades.de[3];
data.de4:=loades.de[4];
data.de5:=loades.de[5];
data.en:=ltempe;
data.en1:=loades.en[1];
data.en2:=loades.en[2];
data.en3:=loades.en[3];
data.en4:=loades.en[4];
data.en5:=loades.en[5];
write(woerter,data);
end;
closefile(woerter);
l := ListView1.Items.Add;
l.Caption:= ltempd;
l.SubItems.Add(ltempe);
end;
end;
end.