procedure TForm1.Button1Click(Sender: TObject);
var
n,i : integer ;
s : string ;
begin
n := Memo1.Lines.Count ;
s := IntToStr(n) + '行' + #13 + #10 ;
for i := 0 to n-1 do
s := s + IntToStr(i) + ':' + Memo1.Lines[i] + #13 + #10 ;
procedure TForm1.Button2Click(Sender: TObject);
var
f : string ;
begin
if (SaveDialog1.Execute) then begin
f := SaveDialog1.FileName ;
try
Memo1.Lines.SaveToFile(f);
finally
;
end;
end;
end;
procedure TForm1.Button2Click(Sender: TObject);
var
f : string ;
begin
if (SaveDialog1.Execute) then begin
f := SaveDialog1.FileName ;
try
// Memo1.Lines.SaveToFile(f); // ANSI
// Memo1.Lines.SaveToFile(f,TEncoding.Unicode); // Unicode
Memo1.Lines.SaveToFile(f,TEncoding.UTF8); // UTF8
finally
;
end;
end;
end;