Solved

Pascal Printing

Posted on 2000-03-21
7
195 Views
Last Modified: 2010-05-18
I was wondering how one could print the contents of a text file to the local LPT 1 printer thanks for your time i would really appreciate it if you could paste a brief example and tell me what include files i need to use... etc
0
Comment
Question by:spaman
  • 3
  • 3
7 Comments
 

Expert Comment

by:kazooie21
ID: 2642780
print it from notepad
0
 

Accepted Solution

by:
washoutt earned 75 total points
ID: 2643367
Okay, here's a sample program that does just that. Any questions please ask:

USES Printer; { So you can print from this program }

VAR TextFile : Text;
        InS      : String;

BEGIN
     Assign(TextFile,'FILE.TXT'); { The file you want to print }
    Reset(TextFile);

   WHILE NOT EOF(TextFile) DO
   BEGIN
      Readln(TextFile,Ins);
      Writeln(Lst,InS);         { Lst = Printer. InS = String to print. }
   END;                            { You CAN say "Writeln(Lst,'Hello There'); }

   Close(TextFile);
END.

does this answer it?
0
 

Author Comment

by:spaman
ID: 2647509
Thanks for hte awsome reply =) it really helped clearify the poorly made help file =P
0
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 

Expert Comment

by:washoutt
ID: 2647895
Glad I could help. Note that Lst is quite very much like your screen, in the sense that DOS sees them both as character output devices. The following statements are also acceptable:

var r : real;

begin
   r := 3.54;

  writeln(lst,'value is ',r:6:2);

<or>


writeln(lst,'a':6,'b':5);

Play around with it.
0
 

Author Comment

by:spaman
ID: 2652076
I was also wondering if there was a way to clear out the printer buffer because to get it to actually print i need to reset the printer each time .....
0
 

Expert Comment

by:washoutt
ID: 2659763
Reset the printer how?

PS What setup you have? What PC & Printer? Using this out of a DOS-shell or plain old ms-dos?
0
 

Author Comment

by:spaman
ID: 2661806
I have a p233 with an epson stylus 640 . i am running the pascal stuff out of a dos shell under windows
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

How do we balance the user experience (UX) with reasonable security measures? It can be done, if you keep these fundamentals in mind.
Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

813 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

12 Experts available now in Live!

Get 1:1 Help Now