home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 10 / 10.iso / l / l360 / 3.ddi / PRINTESC.@BL / PRINTESC.CBL
Encoding:
Text File  |  1991-04-08  |  2.4 KB  |  58 lines

  1.       $set ans85 noosvs mf
  2.       ************************************************************
  3.       *                                                          *
  4.       *              (C) Micro Focus Ltd. 1989                   *
  5.       *                                                          *
  6.       *                     PRINTESC.CBL                         *
  7.       *                                                          *
  8.       *    This program demonstrates how to send escape          *
  9.       *    sequences to a printer.  In this case, an Okidata 93  *
  10.       *    parallel printer was used and the escape sequences in *
  11.       *    question were to set form length to either "7" or     *
  12.       *    "11".  To determine the proper escape sequences for   *
  13.       *    the printer in question, consult your printer manual. *
  14.       *                                                          *
  15.       ************************************************************
  16.  
  17.        file-control.
  18.            select   print-file            assign "LPT1".
  19.  
  20.        data division.
  21.        file section.
  22.        fd  print-file.
  23.        01  print-record                   pic x(60).
  24.  
  25.        working-storage section.
  26.  
  27.        01  form-length-11                 pic x(4)  value x"1b43000b".
  28.        01  form-length-7                  pic x(4)  value x"1b430007".
  29.        01  form-feed                      pic x     value x"0c".
  30.        01  first-line                     pic x(10) value "First Line".
  31.        01  last-line                      pic x(9)  value "Last Line".
  32.  
  33.        procedure division.
  34.        main-line.
  35.            open output print-file.
  36.            perform set-printer-to-7-inches.
  37.            perform set-printer-to-11-inches.
  38.        main-line-end.
  39.  
  40.        exit program.
  41.            close print-file.
  42.            stop run.
  43.        exit-program-end.
  44.  
  45.        set-printer-to-7-inches.
  46.            write print-record from form-length-7.
  47.            write print-record from first-line.
  48.            write print-record from form-feed.
  49.            write print-record from last-line.
  50.        set-printer-to-7-inches-end.
  51.  
  52.        set-printer-to-11-inches.
  53.            write print-record from form-length-11.
  54.            write print-record from first-line.
  55.            write print-record from form-feed.
  56.            write print-record from last-line.
  57.        set-printer-to-11-inches-end.
  58.