(* Collection of code snippets by Arne Vajhøj *)
(* (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) *)
program wrtrec;

type
  testrec = packed record
    a : SmallInt;
    b : LongInt;
    c : string[5];
    d : array [1..2] of string[10];
  end;

var
  testfile : file of testrec;
  buf : testrec;

begin
  assign(testfile, 'C:\work\test.dat');
  rewrite(testfile);
  buf.a := 123;
  buf.b := 456;
  buf.c := 'ABC';
  buf.d[1] := 'DEF';
  buf.d[2] := 'GEH';
  write(testfile, buf);
  buf.a := buf.a + 1;
  buf.b := buf.b + 1;
  write(testfile, buf);
  close(testfile);
end.
