Solved

Pascal Printing

Posted on 2000-03-21
7
197 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
Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

 

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: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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 are looking at this article, you have most likely been hit by some version of ransomware and are trying to find out if there is anything you can do, or what way you should react - READ ON!
With User Account Control (UAC) enabled in Windows 7, one needs to open an elevated Command Prompt in order to run scripts under administrative privileges. Although the elevated Command Prompt accomplishes the task, the question How to run as script…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

861 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