要求不将原有文本覆盖,每一个词一行。
应该这么写:
procedure TForm1.Button1Click(Sender: TObject);
var
F:Textfile;
sl:Tstringlist;
i:integer;
begin
if savedialog1.Execute then
begin
sl:=Tstringlist.Create;
sl.DelimitedText:=memo1.Lines.Text;
Assignfile(F,savedialog1.FileName);
Reset(F);
Append(F);
for i:=0 to sl.Count-1do
Writeln(F,sl.strings);
closefile(F);
sl.Free;
end;
end;