home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / TBTREE.ZIP / MYPRINT.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1988-07-25  |  3.3 KB  |  124 lines

  1. (* TBTree13             Copyright (c)  1988            Dean H. Farwell II    *)
  2.  
  3. unit MyPrint;
  4.  
  5. (****************************************************************************)
  6. (*                                                                          *)
  7. (*                   P R I N T E R   R O U T I N E S                        *)
  8. (*                                                                          *)
  9. (****************************************************************************)
  10.  
  11.  
  12. (* These routines perform some very basic printer commands which can be
  13.    called from Turbo Pascal 4.0.  The routines work by printing appropriate
  14.    control codes to the lst device (which is the printer).  The control codes
  15.    included are for a Gemini 10 but should work for Epson printers.  The codes
  16.    can be changed as required for various printers.  These were really
  17.    developed for my own use and were not intended to be generic enough to
  18.    handle a variety of printers.  I have included them since I use a couple of
  19.    the routines in my TP4Print program and I use one or two routines in
  20.    Page.Pas for printing out the buffer (used for debugging).                *)
  21.  
  22.  
  23. (* Version Information
  24.  
  25.    Version 1.1 - No Changes
  26.  
  27.    Version 1.2 - No Changes
  28.  
  29.    Version 1.3 - No Changes                                                  *)
  30.  
  31.  
  32. (*\*)
  33. (*//////////////////////////  I N T E R F A C E //////////////////////////////*)
  34.  
  35. interface
  36.  
  37. uses
  38.     Printer;
  39.  
  40. const
  41.     BEL    = #7;               (* Bell - 1/4 second *)
  42.     BS     = #8;               (* Backspace *)
  43.     LF     = #10;              (* Linefeed *)
  44.     FF     = #12;              (* Formfeed *)
  45.     CR     = #13;              (* Carriage return *)
  46.     SO     = #14;              (* Double width mode *)
  47.     SI     = #15;              (* Compressed Mode *)
  48.     DC2    = #18;              (* cancel compressed mode *)
  49.     DC4    = #20;              (* cancel double width *)
  50.     DEL    = #127;             (* Delete last character *)
  51.     ESC_1  = #27#45#1;         (* Underline mode *)
  52.     ESC_0  = #27#45#0;         (* Cancel underline mode *)
  53.     ESCE   = #27#69;           (* Emphasized mode *)
  54.     ESCF   = #27#70;           (* Cancel emphasized mode *)
  55.     ESCG   = #27#71;           (* Double strike mode *)
  56.     ESCH   = #27#72;           (* Cancel Double Strike Mode *)
  57.     ESCV1  = #27#86#1;         (* Slashed 0 option *)
  58.     ESCV0  = #27#86#0;         (* Cancel slashed 0 option *)
  59.  
  60.  
  61.  
  62. procedure FormFeed;
  63.  
  64.  
  65. procedure SetSlashedZero;
  66.  
  67.  
  68. procedure SetCompressedMode;
  69.  
  70.  
  71. procedure CancelCompressedMode;
  72.  
  73.  
  74. procedure SetEmphasizedMode;
  75.  
  76.  
  77. procedure CancelEmphasizedMode;
  78.  
  79. (*\*)
  80. (*///////////////////// I M P L E M E N T A T I O N /////////////////////////*)
  81.  
  82. implementation
  83.  
  84.  
  85. procedure FormFeed;
  86.  
  87.     begin
  88.     Write(lst,FF);
  89.     end;
  90.  
  91.  
  92. procedure SetSlashedZero;
  93.  
  94.     begin
  95.     Write(lst,ESCV1);
  96.     end;
  97.  
  98. procedure SetCompressedMode;
  99.  
  100.     begin
  101.     Write(lst,SI);
  102.     end;
  103.  
  104. procedure CancelCompressedMode;
  105.  
  106.     begin
  107.     Write(lst,DC2);
  108.     end;
  109.  
  110. procedure SetEmphasizedMode;
  111.  
  112.     begin
  113.     Write(lst,ESCE);
  114.     end;
  115.  
  116. procedure CancelEmphasizedMode;
  117.  
  118.     begin
  119.     Write(lst,ESCF);
  120.     end;
  121.  
  122.  
  123. end.                                                  (* end of MyPrint unit *)
  124.