Solved

Printing a text file

Posted on 1998-07-05
9
219 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
9 Comments
 
LVL 2

Expert Comment

by:omsec
ID: 1217158
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
ID: 1217159
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
ID: 1217160
ok...give me ur eMail or ICQ
0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

Author Comment

by:Gurkin
ID: 1217161
my E-mail is : psychoted@intekom.co.za
0
 
LVL 2

Expert Comment

by:omsec
ID: 1217162
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
ID: 1217163
thanx i appreciate your help
0
 

Author Comment

by:Gurkin
ID: 1217164
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
ID: 1217165
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
ID: 1217166
Thanx a million scroll, I really appreciate it......... cheers
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Delphi ADO query as a string 4 2,766
Delphi - What Does "F" Symbolize? 2 488
Convert date 6 410
proper way to parse url in delphi 2 290
Unified and professional email signatures help maintain a consistent company brand image to the outside world. This article shows how to create an email signature in Exchange Server 2010 using a transport rule and how to overcome native limitations …
An introduction to the wonderful sport of Scam Baiting.  Learn how to help fight scammers by beating them at their own game. This great pass time helps the world, while providing an endless source of entertainment. Enjoy!
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

734 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