unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 =
class(TForm)
Button1: TButton;
Button2: TButton;
Memo1: TMemo;
Button3: TButton;
Button4: TButton;
Button5: TButton;
Label1: TLabel;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure Button4Click(Sender: TObject);
procedure Button5Click(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
// Laden
begin
memo1.Lines.SaveToFile('
c:\temp\test.txt');
end;
procedure TForm1.Button2Click(Sender: TObject);
// Speichern
begin
memo1.Lines.LoadFromFile('
c:\temp\test.txt');
end;
procedure TForm1.Button3Click(Sender: TObject);
// Memo leeren
begin
memo1.Clear;
end;
procedure TForm1.Button4Click(Sender: TObject);
// Cursor setzen
begin
memo1.SelStart:=Length(memo1.Lines.Text);
memo1.SetFocus;
end;
procedure TForm1.Button5Click(Sender: TObject);
// Anzhl Zeilen Auslesen und anzeigen
begin
Label1.Caption:=inttostr(Memo1.Lines.Count);
end;
end.