Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Printer in Pascal

0 views
Skip to first unread message

Sam Jones

unread,
Jun 17, 2000, 3:00:00 AM6/17/00
to
I have just started a class in Pascal and am using Turbo Pascal 7.0 (dos).
I am supposed to print out a copy of the program, but can't get my printer
to respond. I've tried all the methods listed in the textbook such as using
the PrintScreen button, Ctrl+PrntScrn, etc.

I'm using Win98 2nd ed. with an HP deskjet printer. Any info would be
greatly appreciated.

Thanks,

Sam Jones


Clif Penn

unread,
Jun 17, 2000, 3:00:00 AM6/17/00
to
On Sat, 17 Jun 2000 22:53:38 GMT, "Sam Jones" <sa...@boneshaker.com>
wrote:

It depends on which port your printer is plugged into. Read your
program out as a textfile one line at a time and use one of these two
methods.

Program PrintTest;
USES PRINTER;
CONST dest = 'LPT1';
VAR
f, prt:Text;
source, s:String;

Begin
{If your printer is in LPT1, all you need is 'Uses printer;' to
declare the Turbo Pascal Unit. The variable 'Lst' (case insensitive)
is built in and the TPU takes care of opening and closing the output.}

Write('Enter file name: '); Readln(source);
Assign(f, source);
Reset(f);
While not eof(f) Do
Begin
Readln(f, s); {reads one line}
Writeln(lst, s); {If your printer is in LPT1}
End;

{If your printer is NOT in LPT1, CHANGE dest = [proper port] and use
this method}

(*
Assign(prt, dest); {assign printer to port}
Rewrite(prt); {open for output}
{ read file as above }
Begin
..........
Writeln(prt, s);
End;
Close(prt); *)
End.


Jud McCranie

unread,
Jun 18, 2000, 3:00:00 AM6/18/00
to
"Sam Jones" <sa...@boneshaker.com> wrote:

>I have just started a class in Pascal and am using Turbo Pascal 7.0 (dos).
>I am supposed to print out a copy of the program, but can't get my printer
>to respond. I've tried all the methods listed in the textbook such as using
>the PrintScreen button, Ctrl+PrntScrn, etc.

In the IDE, go to FILE and then PRINT.

Jud McCranie

Dr John Stockton

unread,
Jun 18, 2000, 3:00:00 AM6/18/00
to
JRS: In article <SjT25.7209$C44.4...@bgtnsc05-news.ops.worldnet.att.n
et> of Sat, 17 Jun 2000 22:53:38 seen in news:comp.lang.pascal.borland,

Sam Jones <sa...@boneshaker.com> wrote:
>I have just started a class in Pascal and am using Turbo Pascal 7.0 (dos).
>I am supposed to print out a copy of the program, but can't get my printer
>to respond. I've tried all the methods listed in the textbook such as using
>the PrintScreen button, Ctrl+PrntScrn, etc.
>
>I'm using Win98 2nd ed. with an HP deskjet printer. Any info would be
>greatly appreciated.

Assuming that your Win98 & HPDJ are properly set up, just open the file
in Win98 Notepad, WordPad, etc. and print it from there.

--
© John Stockton, Surrey, UK. j...@merlyn.demon.co.uk Turnpike v4.00 MIME. ©
Web <URL: http://www.merlyn.demon.co.uk/> - w. FAQish topics, links, acronyms
PAS, EXE in <URL: http://www.merlyn.demon.co.uk/programs/> - see 00index.txt.
Dates - miscdate.htm moredate.htm holidays.htm pas-time.htm critdate.htm &c.

Sam Jones

unread,
Jun 19, 2000, 3:00:00 AM6/19/00
to
Thank you everyone for your help. I'm afraid that going to File and Print
didn't work. That was the first thing I tried. Since I can't send a
cartoon of me slapping myself on the forehead, I will just leave it to your
imagination. Of course it was a simple matter to copy the .pas file to the
desktop and rename it as a text file! I was just complicating things by
trying to do it with Pascal.

Once again, thanks for the replies.

Regards,
Samj

news:wCOQ85Bf...@merlyn.demon.co.uk...> Assuming that your Win98 & HPDJ

Dr John Stockton

unread,
Jun 19, 2000, 3:00:00 AM6/19/00
to
JRS: In article <Kqg35.8597$Uw3.5...@bgtnsc04-news.ops.worldnet.att.n
et> of Mon, 19 Jun 2000 03:27:38 seen in news:comp.lang.pascal.borland,

Sam Jones <sa...@boneshaker.com> wrote:
>Thank you everyone for your help. I'm afraid that going to File and Print
>didn't work. That was the first thing I tried. Since I can't send a
>cartoon of me slapping myself on the forehead, I will just leave it to your
>imagination. Of course it was a simple matter to copy the .pas file to the
>desktop and rename it as a text file! I was just complicating things by
>trying to do it with Pascal.

Why rename it? Notepad (etc.) can open a *.pas file; or, if you have a
copy of Notepad (etc.) open, you can drag a file from, say, Windows
Explorer & drop it into Notepad (etc.).

Or you can use (I think) the print command of File Manager, which is in
Win98 somewhere.

--
© John Stockton, Surrey, UK. j...@merlyn.demon.co.uk Turnpike v4.00 MIME ©
Web <URL:ftp://garbo.uwasa.fi/pc/link/tsfaqn.zip> - Timo Salmi's Usenet Q&A.
Web <URL:http://www.merlyn.demon.co.uk/news-use.htm> : about usage of News.
No Encoding. Quotes before replies. Snip well. Write clearly. Don't Mail News.

Jud McCranie

unread,
Jun 20, 2000, 3:00:00 AM6/20/00
to
"Sam Jones" <sa...@boneshaker.com> wrote:

>Thank you everyone for your help. I'm afraid that going to File and Print
>didn't work.

It works for me.

Jud McCranie

0 new messages