Solved

Pascal Printing

Posted on 2000-03-21
7
201 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
[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
  • 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
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.

 

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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

A hard and fast method for reducing Active Directory Administrators members.
A big percent of today’s marketing activity is performed through the online environment. The marketing strategies that have existed a decade ago no longer relate to what’s happening today. We’re currently facing a revolutionary era, called the digit…

738 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