home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / database / laserprt.zip / LASERPRT.PRG < prev   
Text File  |  1988-06-14  |  3KB  |  106 lines

  1. Laserprt.PRG
  2. * Program ...: Laserprt.PRG
  3. * Author ....: James H. Chuang
  4. * Date ......: May 1, 1988
  5. * Version ...: dBASE III PLUS
  6. * Note(s) ...: Sends escape codes to set the Hewlett Packard
  7. *              LaserJet to print with various attributes.
  8. *
  9. SET TALK OFF
  10. CLEAR
  11. TEXT
  12.  
  13.  
  14.           This program sends escape sequences to your Hewlett Packard
  15.           LaserJet to change the printer's setup and typestyles. It
  16.           will not work with other printers unless they emulate the
  17.           Hewlett Packard LaserJet.
  18.           
  19.           Only the standard Courier and Line Printer fonts available
  20.           on an unadorned LaserJet are supported. Line Printer
  21.           may not be available in Portrait orientation
  22.           without a font cartridge.
  23.  
  24.  
  25. ENDTEXT
  26. WAIT
  27. esc       = CHR(27)
  28. prtreset  = esc + "E"
  29. portrait  = esc + "&l0O"
  30. landscape = esc + "&l1O"
  31. stdpitch  = esc + "(s10H"
  32. compitch  = esc + "(s16.66H"
  33. marginsd  = esc + "&a"
  34. marginpg  = esc + "&l"
  35. legal     = marginpg + "84P"
  36. normal    = marginpg + "66P"
  37. leftmrg   = "L"
  38. rightmrg  = "M"
  39. topmargin = "E"
  40. textlen   = "F"
  41. pgeject   = CHR(12)
  42. CLEAR
  43. @  1, 21  SAY "L A S E R   P R I N T E R   S E T U P"
  44. @  5, 11  SAY "Print Orientation     (Portrait/Landscape)"
  45. @  7, 11  SAY "Print Size            (Normal/Compressed)"
  46. @  9, 11  SAY "Page Length           (Normal/Legal)"
  47. @ 11, 11  SAY "Left Margin           (Number of Spaces)"
  48. @ 13, 11  SAY "Right Margin          (Number of Spaces)"
  49. @ 15, 11  SAY "Top Margin            (Number of Lines)"
  50. @ 17, 11  SAY "Text Length           (Number of Lines)"
  51. @  0,  0  TO  2, 79 DOUBLE
  52. orient = " "
  53. DO WHILE .NOT. orient $ "PL"
  54.    orient = "P"
  55.    @  5, 65  GET orient PICTURE "!"
  56.    READ
  57. ENDDO
  58. prtsize = " "
  59. DO WHILE .NOT. prtsize $ "CN"
  60.    prtsize = "N"
  61.    @  7, 65  GET prtsize PICTURE "!"
  62.    READ
  63. ENDDO
  64. pglen = " "
  65. DO WHILE .NOT. pglen $ "LN"
  66.    pglen = "N"
  67.    @  9, 65  GET pglen PICTURE "!"
  68.    READ
  69. ENDDO
  70. lftmg = 10
  71. rgtmg = 75
  72. topmg =  3
  73. txlen = IIF(pglen = "N", 60, 78)
  74. @ 11, 64 GET lftmg PICTURE "99" RANGE  3, 99
  75. @ 13, 64 GET rgtmg PICTURE "99" RANGE  3, 99
  76. @ 15, 64 GET topmg PICTURE "99" RANGE  3, 60
  77. @ 17, 64 GET txlen PICTURE "99" RANGE  1, 78
  78. READ
  79. okay = .T.
  80. @ 22, 0 SAY "Send Codes to Printer? Y/N" GET okay PICTURE "Y"
  81. READ
  82. @ 22, 0
  83. IF okay
  84.    prtcode = prtreset + IIF(orient = "L", landscape, portrait)
  85.    prtcode = prtcode  + IIF(prtsize = "C", compitch, stdpitch)
  86.    prtcode = prtcode  + IIF(pglen = "L", legal, normal)
  87.    prtcode = prtcode  + marginsd + LTRIM(STR(lftmg, 2, 0)) + leftmrg
  88.    prtcode = prtcode  + marginsd + LTRIM(STR(rgtmg, 2, 0)) + rightmrg
  89.    prtcode = prtcode  + marginpg + LTRIM(STR(topmg, 2, 0)) + topmargin
  90.    prtcode = prtcode  + marginpg + LTRIM(STR(txlen, 2, 0)) + textlen
  91.    prtcode = prtcode  + pgeject
  92.    SET PRINT ON
  93.    SET CONSOLE OFF
  94.    ?? prtcode
  95.    SET CONSOLE ON
  96.    SET PRINT OFF
  97.    CLEAR
  98.    @ 22, 0 SAY "Printer setup has been changed."
  99. ELSE
  100.    @ 22, 0 SAY "Printer is unchanged."
  101. ENDIF
  102. @ 23, 0 SAY "Type   ASSIST <Return>   to return to the Assistant."
  103. SET TALK ON
  104. * EOP: Laserprt.PRG
  105.  
  106.