var f: TextFile; begin if OpenDialog1.Execute then begin { open a text file } AssignFile(f, OpenDialog1.FileName); Append(f); Writeln(f, 'I am appending some stuff to the end of the file.'); { insert code here that would require a Flush before closing the file } Flush(f); { ensures that the text was actually written to file } CloseFile(f); end;end;
var f: TextFile; begin if OpenDialog1.Execute then begin AssignFile(f, OpenDialog1.FileName);//打开文件 Append(f);//切换到添加方式 Writeln(f, 'I am appending some stuff to the end of the file.'); // 写一行 Flush(f); { 确保写入的数据生效} CloseFile(f);//关闭文件 end;end;这是DELPHI帮助上的,建议你可以多看一点帮助,看多了英语不会难的
begin
if OpenDialog1.Execute then
begin { open a text file }
AssignFile(f, OpenDialog1.FileName);
Append(f);
Writeln(f, 'I am appending some stuff to the end of the file.');
{ insert code here that would require a Flush before closing the file }
Flush(f); { ensures that the text was actually written to file }
CloseFile(f);
end;end;
begin
if OpenDialog1.Execute then
begin
AssignFile(f, OpenDialog1.FileName);//打开文件
Append(f);//切换到添加方式
Writeln(f, 'I am appending some stuff to the end of the file.'); // 写一行
Flush(f); { 确保写入的数据生效}
CloseFile(f);//关闭文件
end;end;这是DELPHI帮助上的,建议你可以多看一点帮助,看多了英语不会难的