I'm using Win98 2nd ed. with an HP deskjet printer. Any info would be
greatly appreciated.
Thanks,
Sam Jones
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.
>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
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.
Once again, thanks for the replies.
Regards,
Samj
news:wCOQ85Bf...@merlyn.demon.co.uk...> Assuming that your Win98 & HPDJ
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.
>Thank you everyone for your help. I'm afraid that going to File and Print
>didn't work.
It works for me.
Jud McCranie