delphi中,请问如何将列表中的内容保存成文本文件?
procedure TForm1.Button2Click(Sender: TObject);
var
i : Integer;
F : TextFile;
begin
if SaveDialog1.Execute then
begin
AssignFile(F,SaveDialog1.FileName);
Write(F);
For i := 0 to ListBox1.Count - 1 do;
Writeln(i);
CloseFile(F);
end;
end;