Solved

Printing a text file

Posted on 1998-07-05
9
193 Views
Last Modified: 2010-04-16
Hi I have to do a project in pascal 7 my project is finished
and it saves a report to a text file, now I would like to write a procedure that will test if the printer is on, on-line, has paper in etc and if all these are true, it must print the text file. I need help urgently!! Please.
0
Comment
Question by:Gurkin
  • 5
  • 3
9 Comments
 
LVL 2

Expert Comment

by:omsec
Comment Utility
I have never done that, so I only post this as Comment and not as an Anwser, but in TP/BP is a unit called PRINTER.TPU. Just add this to the USES-Clause of your program and see the Documentation about its procedures.
0
 

Author Comment

by:Gurkin
Comment Utility
I don't have the printer.tpu unit do you know where I could get it? maybe you could mail it to me?
0
 
LVL 2

Expert Comment

by:omsec
Comment Utility
ok...give me ur eMail or ICQ
0
 

Author Comment

by:Gurkin
Comment Utility
my E-mail is : psychoted@intekom.co.za
0
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 2

Expert Comment

by:omsec
Comment Utility
uhm i couldnt find the file on my HDDs so it probly has to be linked in the TPU Library. Just try to add Printer or Printers in the uses-clause of or program
0
 

Author Comment

by:Gurkin
Comment Utility
thanx i appreciate your help
0
 

Author Comment

by:Gurkin
Comment Utility
omsec I put printer in my uses and there are no problems, now how do I use it????
0
 

Accepted Solution

by:
scroll earned 50 total points
Comment Utility
Here is the code to test if the printer is working and send something to it:

uses printer;
begin
  {$I-}
  write (lst, #0);
  {$I+}
  if IOResult <> 0 then
    write ('Printer off, not present or not ready')
  else
    write (lst, 'whatever');  {Send the string 'whatever' to the printer}
end.

Regards,
Scroll

0
 

Author Comment

by:Gurkin
Comment Utility
Thanx a million scroll, I really appreciate it......... cheers
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Learn to move / copy / export exchange contacts to iPhone without using any software. Also see the issues in configuration of exchange with iPhone to migrate contacts.
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now