Registriert seit: 29. Mai 2002
37.621 Beiträge
Delphi 2006 Professional
|
Re: Pfade in Datei speichern und Zeilenweise auslesen
7. Dez 2004, 16:18
Delphi-Quellcode:
type
TForm1 = class(TForm)
Button1: TButton;
OpenDialog1: TOpenDialog;
Button2: TButton;
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private-Deklarationen }
sl: TStringList;
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure AddFiles(var sl: TStringList; Filename: String);
begin
sl.Add(Filename);
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
sl := TStringList.Create;
end;
procedure TForm1.FormDestroy(Sender: TObject);
begin
sl.Free;
end;
procedure TForm1.Button2Click(Sender: TObject);
var
i: Integer;
begin
for i := 0 to sl.Count- 1 do
ShowMessage(sl.Strings[i]);
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
if OpenDialog1.Execute then
AddFiles(sl, OpenDialog1.FileName);
end;
Michael Ein Teil meines Codes würde euch verunsichern.
|