Pascal Printing

Posted on 2000-03-21
Medium Priority
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
Question by:spaman
  • 3
  • 3

Expert Comment

ID: 2642780
print it from notepad

Accepted Solution

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;

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

      Writeln(Lst,InS);         { Lst = Printer. InS = String to print. }
   END;                            { You CAN say "Writeln(Lst,'Hello There'); }


does this answer it?

Author Comment

ID: 2647509
Thanks for hte awsome reply =) it really helped clearify the poorly made help file =P
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.


Expert Comment

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;

   r := 3.54;

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



Play around with it.

Author Comment

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 .....

Expert Comment

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?

Author Comment

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

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.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

The narrative of smartphone revolution is incomplete without the mention of apps, for the latter is being used today for a variety of purposes. From booking hotel (or plane) tickets to ordering food to even conducting small businesses, mobiles apps …
In this article the author has highlighted some of the best features of best data recovery brands that are going to rock in 2018 (in the author's humble opinion).
How to fix display issue, screen flickering issue when I plug in power cord to the machine. Before I start explaining the solution lets check out once the issue how it looks like after I connect the power cord. most of you also have faced this…
This video tutorial shows you the steps to go through to set up what I believe to be the best email app on the android platform to read Exchange mail.  Get the app on your phone: The first step is to make sure you have the Samsung Email app on your …
Suggested Courses

619 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