home *** CD-ROM | disk | FTP | other *** search
/ Point Programming 1 / PPROG1.ISO / pascal / swag / printing.swg / 0011_PRINTER5.PAS.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1993-05-28  |  833 b   |  34 lines

  1. {
  2.  EPSON Printer. I'm using TP7.0. Everythings works fine except one
  3.  situation that occured when a Character 26 (Ctrl-Z which is Eof) is in
  4.  
  5. This may be the easy way out, but why not just use BIOS interrupt $17?
  6. It's probably slower, but it'll work.
  7. }
  8.  
  9. Type PGraphics : ^Graphics;
  10.      Graphics : Array [1..65535] of Byte;
  11.  
  12. Function InitPort (PortNum : Byte) : Byte; {returns status}
  13. Var Regs : Registers;
  14. begin
  15.   Regs.DX := PortNum;
  16.   Intr ($17, Regs);
  17.   InitPort := Regs.AL;
  18.   end;
  19.  
  20. Procedure OutStreamofStuff (PortNum : Byte; Where : PGraphics; Len : Word);
  21. Var Count : Word; Regs : Registers;
  22. begin
  23.   Regs.DX := NumPort;
  24.   For Count := 1 to Len do
  25.       begin
  26.         Regs.AL := ^Where[Count];
  27.         end;
  28.   end;
  29.  
  30. InitPort returns
  31.    144 Printer OK
  32.     24 Printer not OK
  33.    184 Printer is off
  34.