(* 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 writerecs;

{$APPTYPE CONSOLE}

uses
  SysUtils;

type
  TFooBar = record
     a : string[10];
     b : string[20];
     c : string[30];
  end;

var
  i : integer;
  data : array [1..4] of TFooBar;
  f : file of TFooBar;

begin
  data[1].a := '1a';
  data[1].b := '1b';
  data[1].c := '1c';
  data[2].a := '2a';
  data[2].b := '2b';
  data[2].c := '2c';
  data[3].a := '3a';
  data[3].b := '3b';
  data[3].c := '3c';
  data[4].a := '4a';
  data[4].b := '4b';
  data[4].c := '4c';
  assign(f, 'C:\foobar.dat');
  rewrite(f);
  for i := low(data) to high(data) do begin
    write(f, data[i]);
  end;
  close(f);
end.
