(* 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 relwrt(input,output);

type
   string = varying [255] of char;

var
   i : integer;
   buf : string;
   f : file of string;

begin
   open(f, 'rel.dat', new,
        organization := relative, record_length := 512, record_type := variable,
        access_method := direct);
   rewrite(f);
   for i := 1 to 100 do begin
      buf := 'This is line #' + dec(i, 4);
      locate(f, i);
      f^ := buf;
      put(f);
   end;
   close(f);
end.
