unit UnitNix;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;
type
TForm1 =
class(TForm)
Button1: TButton;
Button2: TButton;
Button3: TButton;
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
private
{ Private-Deklarationen }
sl: TStringList;
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.FormCreate(Sender: TObject);
begin
sl := TStringList.Create;
end;
procedure TForm1.FormDestroy(Sender: TObject);
begin
if Assigned(sl)
then
FreeAndNil(sl);
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
if Assigned(sl)
then
begin
sl.Add('
eine Zeile');
Button2Click(self);
Button3Click(self);
end;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
if Assigned(sl)
then
sl.Add('
eine weitere Zeile');
end;
procedure TForm1.Button3Click(Sender: TObject);
begin
if Assigned(sl)
then
sl.SaveToFile('
C:\blablubb.txt');
end;
end.