Printer Unit in WinTurbo Pascal 1.5 
Author Message
 Printer Unit in WinTurbo Pascal 1.5

Hello,
    I would like to know where I could find the printer.tpu unit in WinTurbo
Pascal 1.5 or the net. I recently attempted to use the printer in one of my
programs but the program would not compile it said that it could not find
the printer.tpu unit. I wrote the line: "uses wincrt, printer;" and the
"lst" command used to actually print would not work also. I have a Epson
stylus 640 and win98.

Thank you in advance,
Chris Santamaria



Wed, 18 Jun 1902 08:00:00 GMT  
 Printer Unit in WinTurbo Pascal 1.5

Christopher John Santamaria heeft geschreven in bericht ...

Quote:
>Hello,
>    I would like to know where I could find the printer.tpu unit

in WinTurbo

[snip]

Quote:
>Chris Santamaria

There is no printer.tpu in TPW 1.5. Printer.tpu in TP for Dos is
kept in
the file Turbo.TPL (Use TPUMOVER.EXE to view it) an is
text-based.
In TPW 1.5 printing is bitmapped-based. There is no equivalent
for
printer.tpu for TPW 1.5 AFAIK.

To print in TPW 1.5:
Create a device context (= a sort of bitmap in memory) for the
printer.
Create a handle to it (so you can manipulate it).
Draw everything you want to print on the device context (DC), or
copy it
from the DC that is related to the screen.
You have to use the Escape-function with StartDoc and EndDoc as
parameters.
After printing: remove the printer DC from memory.

If you want to print properly, you have to use GetDeviceCaps.
Look DC, handle, Draw, Escape en GetDeviceCaps up in the
help-pages. You need at least 20 lines of code to print a single
line.

For beginners, use this:
(found in: Turbo Pascal for Windows 3.0 Programming by Tom Swan,
ISBN-0-553-35293-8, page 647)

var Printer: Text;
const
begin
    Assign(Printer,'PRN');
    Rewrite(Printer);
    Writeln(Printer,'If you can read this on the printer; it
works.');
    Write(Printer,#12); {form feed}
    Close(Printer)
end.

Hope this helps somewhat. Huub.



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. printer unit for TPW 1.5

2. printing to printer in turbo pascal 1.5

3. Turbo Pascal for Windows 1.5 - CRT unit

4. Win 1.5 Pascal - CRT Unit - Window positioning

5. TPW 1.5 using LPT1 to print with LEXMARK PRINTER

6. TPW 1.5 and printers

7. Problem printing color bitmap on color printer wih TPW 1.5

8. outputting direct to printer instead of screen - TPW 1.5

9. WinGraph unit for TPW 1.5 now really done

10. TPW 1.5 WINCRT unit - screen sizing

11. TPW 1.5 and the missing Graph unit

12. TP WIN 1.5 - CRT UNIT - any fixes?

 

 
Powered by phpBB® Forum Software