summaryrefslogtreecommitdiff
path: root/fpcdocs/refex/ex52.pp
blob: 67a322ff238969ecd9074eb41e9ab6ced5417a4a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Program Example52;

{ Program to demonstrate the Rewrite function. }

Var F : File;
    I : longint;

begin
  Assign (F,'Test.tmp');
  { Create the file. Recordsize is 4 }
  Rewrite (F,Sizeof(I));
  For I:=1 to 10 do
    BlockWrite (F,I,1);
  close (f);
  { F contains now a binary representation of
    10 longints going from 1 to 10 }
end.