Printing Program Output

If you have questions about any aspect of QBasic programming, or would like to help fellow programmers solve their problems, check out this board!

Moderators: Pete, Mods

Post Reply
Posts: 1
Joined: Fri May 04, 2012 1:34 am

Printing Program Output

Post by jsphilb » Fri May 04, 2012 2:03 am

I have a program that has a tabular output. It could run several pages based on the input parameters. How can I get a paper copy of the output, since the Print command only shows the listing on my computer monitor. Thanks in advance.

Posts: 1
Joined: Fri Mar 29, 2019 9:06 am

Re: Printing Program Output

Post by 970037201 » Fri Mar 29, 2019 9:10 am

The thing you want to use.... Replace "PRINT" with "LPRINT".... works for me! It sends all the output to a serial, Ethernet, wireless, broadband, or USB printer! :mrgreen:

Posts: 5
Joined: Wed Jul 10, 2013 1:28 pm

Re: Printing Program Output

Post by Jack002 » Wed Apr 03, 2019 2:24 pm

Output to a txt file and format it how you like and print that. That's what I'd do

User avatar
Posts: 2442
Joined: Mon Aug 21, 2006 12:40 am
Location: Pittsburgh, PA

Re: Printing Program Output

Post by burger2227 » Fri Apr 05, 2019 7:34 am

Print a text file directly from the command prompt using the default printer by inserting /p prior to the file's name:

Code: Select all

filename$ = "C:\Documents\textfile.txt"
SHELL "Notepad /p "  + filename$.
Please acknowledge and thank members who answer your questions!
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX :
Get my Q-Basics demonstrator: ...

Post Reply