program print (arg: string) [menu];

  var
    lijst: array[1..50] of real;
    pft, s1, s2: string;
    total: real;

procedure Zoek;
  var
    j, lintel: real;
    lin: string;
  begin
    for j := 1 to total do begin
      if (record(lijst[j]) = 0) and (format(75) = 0) then begin
        lintel := nxtline(lin);
        while lintel = 0 do begin
          writeln(out, lin);
          lintel := nxtline(lin);
        end;
      end;
    end;
  end;

procedure Kies;
  var
    uit, i, in: real;
  begin
  writeln('Choose MFNs (max. 50), type one by one, followed by enter.');
  writeln('Last one must be zero.'); 
    uit := 1;
    i := 0;
    while uit = 1 do begin
      write('MFN: ');
      readln(in);
      if in > 0 then begin
        i := i + 1;
        lijst[i] := in;
      end
      else begin
        uit := 0;
        total := i;
      end;
    end;
  end;

begin
  clear;
  writeln('This program accepts a list of MFNs, and a PFT. The records are'); 
  writeln('written to a file or a printer.');
  write('Type the name of the outputfile, or lpt1 for printer: ');
  readln(s2); clear;
  write('Type the name of the PFT, enter = current: ');
  readln(pft);
  if pft <> '' then pft := '@'|pft else pft := '@'|fmtname;
  getfmt(pft); clear;
  s1 := 'out';  
  assign (s1,s2);
  Kies;
  Zoek;
  arg := ' ';
end.
