home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / pascal / library / dos / btree / tree / myprint.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1989-07-13  |  3.6 KB  |  142 lines

  1. (* TBTree16             Copyright (c)  1988,1989       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.  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.    Version 1.4 - No Changes
  32.  
  33.    Version 1.5 - Changed code internally to use Inc and Dec where practical
  34.  
  35.                - Added SoftwareReset routine
  36.  
  37.    Version 1.6 - No Changes                                                  *)
  38.  
  39. (*\*)
  40. (*//////////////////////////  I N T E R F A C E /////////////////////////////*)
  41.  
  42. interface
  43.  
  44. uses
  45.     Printer;
  46.  
  47. const
  48.     BEL    = #7;               (* Bell - 1/4 second *)
  49.     BS     = #8;               (* Backspace *)
  50.     LF     = #10;              (* Linefeed *)
  51.     FF     = #12;              (* Formfeed *)
  52.     CR     = #13;              (* Carriage return *)
  53.     SO     = #14;              (* Double width mode *)
  54.     SI     = #15;              (* Compressed Mode *)
  55.     DC2    = #18;              (* cancel compressed mode *)
  56.     DC4    = #20;              (* cancel double width *)
  57.     ESC_AT = #64;              (* Software reset *)
  58.     DEL    = #127;             (* Delete last character *)
  59.     ESC_1  = #27#45#1;         (* Underline mode *)
  60.     ESC_0  = #27#45#0;         (* Cancel underline mode *)
  61.     ESCE   = #27#69;           (* Emphasized mode *)
  62.     ESCF   = #27#70;           (* Cancel emphasized mode *)
  63.     ESCG   = #27#71;           (* Double strike mode *)
  64.     ESCH   = #27#72;           (* Cancel Double Strike Mode *)
  65.     ESCV1  = #27#86#1;         (* Slashed 0 option *)
  66.     ESCV0  = #27#86#0;         (* Cancel slashed 0 option *)
  67.  
  68.  
  69. procedure FormFeed;
  70.  
  71.  
  72. procedure SetSlashedZero;
  73.  
  74.  
  75. procedure SoftwareReset;
  76.  
  77.  
  78. procedure SetCompressedMode;
  79.  
  80.  
  81. procedure CancelCompressedMode;
  82.  
  83.  
  84. procedure SetEmphasizedMode;
  85.  
  86.  
  87. procedure CancelEmphasizedMode;
  88.  
  89. (*!*)
  90. (*\*)
  91. (*///////////////////// I M P L E M E N T A T I O N /////////////////////////*)
  92.  
  93. implementation
  94.  
  95.  
  96. procedure FormFeed;
  97.  
  98.     begin
  99.     Write(lst,FF);
  100.     end;
  101.  
  102.  
  103. procedure SoftwareReset;
  104.  
  105.     begin
  106.     Write(lst,ESC_AT);
  107.     end;
  108.  
  109.  
  110. procedure SetSlashedZero;
  111.  
  112.     begin
  113.     Write(lst,ESCV1);
  114.     end;
  115.  
  116. procedure SetCompressedMode;
  117.  
  118.     begin
  119.     Write(lst,SI);
  120.     end;
  121.  
  122. procedure CancelCompressedMode;
  123.  
  124.     begin
  125.     Write(lst,DC2);
  126.     end;
  127.  
  128. procedure SetEmphasizedMode;
  129.  
  130.     begin
  131.     Write(lst,ESCE);
  132.     end;
  133.  
  134. procedure CancelEmphasizedMode;
  135.  
  136.     begin
  137.     Write(lst,ESCF);
  138.     end;
  139.  
  140.  
  141. end.                                                  (* end of MyPrint unit *)
  142.