home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / CPM / PARASOL / VIDEOSTO.ARK / OE-PRINT.LIB < prev    next >
Text File  |  1986-08-28  |  3KB  |  87 lines

  1. string    oe.printer.rept        31    value    "";
  2. {----------------------------------------------------------
  3. {    Printer-Selection Inquiry
  4. {
  5. {    in:    printer.to.select
  6. {    out:    Printer is selected, or procedure.aborted is 'Y'
  7. {----------------------------------------------------------
  8. procedure    oe.printer:
  9. begin
  10.                                         redefine screen.data;
  11.             record    selprint;
  12.                 field    selprint.rept.desc        30;
  13.                 field    selprint.option        4;
  14.                 record    selprint.rec;
  15.                     field    selprint.unit        3;
  16.                     field    selprint.width        3;
  17.                     field    selprint.desc        32;
  18.                     endrec;
  19.                 endrec;
  20.                                         endredef;
  21.             record    selprint.save;
  22.                 string ##selprint;
  23.                 endrec;
  24.  
  25.  
  26.     move 0 to procedure.aborted;
  27.     if printer.to.select = "?" then
  28.         move selprint to selprint.save;
  29.         fill selprint with " ";
  30.         move oe.printer.rept to selprint.rept.desc;
  31.         move 0 to oe.printer.rept[byte];
  32.         mcall entry using 14,0;
  33.         mcall entry using 32,0;
  34.         open startup.file shared error standard;
  35.         move 1 to startup.key;
  36.         while startup.key <= 17 do
  37.             subtract 1 from startup.key giving wk.word;
  38.             read startup.file error standard;
  39.             if startup.prn.unit > 15 then
  40.                 move default.printer to startup.prn.unit;
  41.                 fi;
  42.             convert startup.prn.unit to wk.str;
  43.             edit wk.str with "ZZ9";
  44.             index selprint.unit of selprint.rec with wk.word
  45.                                                     giving wk.sp;
  46.             move wk.str to @wk.sp length 3;
  47.  
  48.             convert startup.prn.width to wk.str;
  49.             edit wk.str with "ZZ9";
  50.             index selprint.width of selprint.rec with wk.word
  51.                                                     giving wk.sp;
  52.             move wk.str to @wk.sp length 3;
  53.  
  54.             index selprint.desc of selprint.rec with wk.word
  55.                                                     giving wk.sp;
  56.             move startup.prn.desc to @wk.sp length ##selprint.desc;
  57.  
  58.             add 1 to startup.key;
  59.             od;
  60.         close startup.file error standard;
  61.         mcall entry using 32,prog.user;
  62.         subtract "A" from prog.drive giving wk.byte;
  63.         mcall entry using 14,wk.byte;
  64.  
  65. selprint.get.data:
  66.         move "selprint" to screen.name;
  67.         call get.screen.data;
  68.         if selprint.option = l.END then
  69.             call abort.proc;
  70.             goto oe.printer.exit;
  71.             fi;
  72.         move selprint.option to wk.str;
  73.         call trunc.wk.str;
  74.         scan wk.str for no digits true begin
  75.             move "Printer Number must be numeric" to status.line;
  76.             call status.line.display;
  77.             goto selprint.get.data;
  78.             end;
  79.         convert wk.str to printer.to.select;
  80. oe.printer.exit:
  81.         move selprint.save to selprint;
  82.         fi;
  83.     if procedure.aborted = 0 then
  84.         call select.printer;
  85.         fi;
  86. end;
  87.