unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 =
class(TForm)
Button1: TButton;
Edit1: TEdit;
Edit2: TEdit;
Edit3: TEdit;
Button2: TButton;
procedure FormClose(Sender: TObject;
var Action: TCloseAction);
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
list : tstringlist;
implementation
{$R *.dfm}
procedure TForm1.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
list.free;
end;
procedure TForm1.Button1Click(Sender: TObject);
var a : integer;
begin
list := tstringlist.Create;
list.SaveToFile ('
test');
for a := 1
to 3
do
list.add ((findcomponent ('
edit' + inttostr (a))
as tedit).text);
end;
procedure TForm1.Button2Click(Sender: TObject);
var a,b : integer;
begin
list := tstringlist.create;
list.loadfromfile ('
test');
for a := 1
to 3
do
for b := 0
to 2
do
(findcomponent ('
edit' + inttostr (a))
as tedit).Text := list.Strings [b];
end;
end.