?
Solved

Pascal Printing

Posted on 2000-03-21
7
Medium Priority
?
210 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 300 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
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.

 

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

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

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

Applications for our next round of the Experts Exchange Scholarship Contest are starting to roll in. It made us wonder what our past winners are up to these days. Here's a look at what four winners experienced with the contest and what they're doing…
Last month Marc Laliberte, WatchGuard’s Senior Threat Analyst, contributed reviewed the three major email authentication anti-phishing technology standards: SPF, DKIM, and DMARC. Learn more in part 2 of the series originally posted in Cyber Defense …
Screencast - Getting to Know the Pipeline
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Suggested Courses

850 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