ex3.pp 455 B

12345678910111213141516
  1. Program Example3;
  2. { Program to demonstrate the Append function. }
  3. Var f : text;
  4. begin
  5. Assign (f,'test.txt');
  6. Rewrite (f); { file is opened for write, and emptied }
  7. Writeln (F,'This is the first line of text.txt');
  8. close (f);
  9. Append(f); { file is opened for write, but NOT emptied.
  10. any text written to it is appended.}
  11. Writeln (f,'This is the second line of text.txt');
  12. close (f);
  13. end.