summaryrefslogtreecommitdiff
path: root/fpcdocs/refex/ex3.pp
blob: 57b46f56793e2a75cc382a21b26b0a507dfb2922 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Program Example3;

{ Program to demonstrate the Append function. }

Var f : text;

begin
  Assign (f,'test.txt');
  Rewrite (f);            { file is opened for write, and emptied }
  Writeln (F,'This is the first line of text.txt');
  close (f);
  Append(f);              { file is opened for write, but NOT emptied.
                            any text written to it is appended.}
  Writeln (f,'This is the second line of text.txt');
  close (f);
end.