(* 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) *)
[inherit('sys$library:pascal$lib_routines')]
program process_p(input,output);

type
   pstring = varying[256] of char;

procedure records(fnm : pstring);

var
   f : text;
   line : pstring;
   ix, i : integer;

begin
   write(fnm, ' Pascal ReadLn:');
   open(f, fnm, old);
   reset(f);
   ix := 0;
   while not eof(f) do begin
      readln(f, line);
      for i := 1 to line.length do begin
         write(' ', hex(ord(line[i]), 2));
      end;
      write(' *');
      ix := ix + line.length;
   end;
   close(f);
   writeln(' (', ix:1, ' bytes)');;
end;

var
   fnm : pstring;

begin
   lib$get_foreign(fnm.body, , fnm.length);
   records(fnm);
end.
