H hotsoup Unregistered / Unconfirmed GUEST, unregistred user! 2002-09-18 #1 请问如何重复写入文本文件,而不产生覆盖.给段代码吧!
W www Unregistered / Unconfirmed GUEST, unregistred user! 2002-09-18 #2 var FileText:TStrings; begin FileText:=TStringList.Create; FileText.LoadFromFile('aaa.txt'); FileText.Add('asfasdfasdfasdfasdfasd'); fileText.Savetofile('aaa.txt'); FileText.Free; end;
var FileText:TStrings; begin FileText:=TStringList.Create; FileText.LoadFromFile('aaa.txt'); FileText.Add('asfasdfasdfasdfasdfasd'); fileText.Savetofile('aaa.txt'); FileText.Free; end;
L lcl_003 Unregistered / Unconfirmed GUEST, unregistred user! 2002-09-18 #3 var file1:textfile; assginfile(file1,路径): reset() 重写 append() 追加
F fontain Unregistered / Unconfirmed GUEST, unregistred user! 2002-09-18 #4 var f: TextFile; begin assignfile(f,'d:/aaa.txt'); if FileExists('d:/aaa.txt') then append(f) else rewrite(f); writeln(f,'ddddd'); flush(f); closefile(f); end;
var f: TextFile; begin assignfile(f,'d:/aaa.txt'); if FileExists('d:/aaa.txt') then append(f) else rewrite(f); writeln(f,'ddddd'); flush(f); closefile(f); end;