home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / simtel / sigm / vols000 / vol080 / srtprt.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1984-04-29  |  1.1 KB  |  43 lines

  1. EXTERNAL SORT::srtprt(1);
  2.  
  3. PROCEDURE WriteItems;
  4. VAR
  5.   ptr    : boolean;
  6.   fptr    : file of char;
  7.   printer: char;
  8.   entry  :ItemPointers;
  9. begin
  10.   write('Enter "P" for a printer listing, anything else to skip');
  11.   readln(printer);
  12.   if (printer = 'P') or (printer = 'p') then
  13.     begin
  14.     ptr := true;
  15.     rewrite('lst:',fptr);
  16.     write(fptr,chr(15));    {single space key}
  17.     writeln(fptr,'    File number (ssic) ordered listing');
  18.     writeln(fptr,' SSIC    Subject                         Action  Info');
  19.     end else ptr := false;
  20.   entry := ListHead;
  21.   While entry <> NIL DO
  22.     WITH entry^ DO
  23.       begin
  24.       Write(fout,item);
  25.       if ptr = true then 
  26.          begin
  27.          WITH item do begin
  28.          writeln(fptr,ssic,' ',subj,' ',action,' ',info);
  29.      end {with}
  30.      end; {if ptr = true}
  31.       entry := Next
  32.       end;    {with}
  33.     with newitem do
  34.       begin
  35.       ssic := '-----';
  36.       subj := 'end of sort by ssic                          ';
  37.       action := '      ';
  38.       info := 'EOF             ';
  39.       end; {with}
  40.       write(fout,newitem);
  41. end; (* WriteItems *)
  42.  .
  43.