Solved

Printing a text file

Posted on 1998-07-05
9
224 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: 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.

Question has a verified solution.

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

If you need to forecast numbers -- typically for finance -- the Windows and Mac versions of Excel 2016 have a basket of tools to get the job done.
Let's recap what we learned from yesterday's Skyport Systems webinar.
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

632 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