您需要做的就是在附加模式下打开文件,然后添加文本。它将将新数据放在文件的末尾:
AssignFile(tfOut, C_FNAME);
try
// Open for append, write and close.
append(tfOut);
writeln(tfOut, 'New data for text file');
writeln(tfOut, 'New informtion should be at the end of the file.');
CloseFile(tfOut);
except
on E: EInOutError do
writeln('File error. Elaboration: ', E.Message);
end;
使用其他方法使用
tstringlist
是: