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!
Post Reply
jsphilb
Newbie
Posts: 1
Joined: Fri May 04, 2012 1:34 am

Printing Program Output

Post by jsphilb »

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.
970037201
Newbie
Posts: 1
Joined: Fri Mar 29, 2019 9:06 am

Re: Printing Program Output

Post by 970037201 »

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:
Jack002
Newbie
Posts: 5
Joined: Wed Jul 10, 2013 1:28 pm

Re: Printing Program Output

Post by Jack002 »

Output to a txt file and format it how you like and print that. That's what I'd do
User avatar
burger2227
Veteran
Posts: 2466
Joined: Mon Aug 21, 2006 12:40 am
Location: Pittsburgh, PA

Re: Printing Program Output

Post by burger2227 »

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$.
https://www.qb64.org/wiki/SHELL
Please acknowledge and thank members who answer your questions!
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0
Post Reply