943,651 Members | Top Members by Rank

Ad:
You are currently viewing page 1 of this multi-page discussion thread
Apr 27th, 2005
0

print to USB from Qbasic

Expand Post »
I recently updated my system to XP-2 with a pentium III. I have a number of qbasic programs I developed to use in my hobbies and lo and behold, I can't print to my usb port. The programs run okay. I should think this is a problem that has been solved many times but I haven't run acrossed the answer. Perhaps print-to-file then open and print the file with notepad or something. Any ideas?

Thanks, Paul
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
paul2594 is offline Offline
2 posts
since Apr 2005
May 6th, 2005
0

Re: print to USB from Qbasic

You might take a look at
USB Central
http://www.lvr.com/usb.htm

USBs like to use drivers.
Moderator
Reputation Points: 1333
Solved Threads: 1403
DaniWeb's Hypocrite
vegaseat is offline Offline
5,792 posts
since Oct 2004
May 7th, 2005
0

Re: print to USB from Qbasic

Thanks! i check it out but i think i found a solution and it was as i suspected with a little wrinkle thrown in that makes it easier. 1st - create a text file the with the SHELL command you can open wordpad with a /p and the file name and wordpad will open the file and send it to the default windows printer. i haven't developed the code yet so wish me luck.

Thanks for you help. paul
Reputation Points: 10
Solved Threads: 0
Newbie Poster
paul2594 is offline Offline
2 posts
since Apr 2005
Mar 22nd, 2008
0

Re: print to USB from Qbasic

Dear Paul,
this article might help: How to print from BASIC DOS to any Windows printer
Regards,
Davide
Reputation Points: 10
Solved Threads: 1
Newbie Poster
printfil is offline Offline
5 posts
since Mar 2008
Mar 23rd, 2008
0

Re: print to USB from Qbasic

You can use LPRINT , can't you?
Reputation Points: 118
Solved Threads: 30
Posting Shark
linux is offline Offline
931 posts
since Aug 2006
Mar 24th, 2008
0

Re: print to USB from Qbasic

Click to Expand / Collapse  Quote originally posted by linux ...
You can use LPRINT , can't you?
LPRINT is hardcoded to LPT1: (only) and doesn't offer a way to close the LPT port at the print job end, causing long delays in newer Windows systems. Changing "LPRINT" with "PRINT #" as explained in the article above is easy with a good text editor and solves both those problems.
Regards,
Davide
Reputation Points: 10
Solved Threads: 1
Newbie Poster
printfil is offline Offline
5 posts
since Mar 2008
Jun 7th, 2008
0

Re: print to USB from Qbasic

Click to Expand / Collapse  Quote originally posted by paul2594 ...
Thanks! i check it out but i think i found a solution and it was as i suspected with a little wrinkle thrown in that makes it easier. 1st - create a text file the with the SHELL command you can open wordpad with a /p and the file name and wordpad will open the file and send it to the default windows printer. i haven't developed the code yet so wish me luck.

Thanks for you help. paul
OPEN "O",1,"PRINT.TMP"
PRINT #1, "Just testing the code."
CLOSE 1
SHELL "C:\PATH\WORDPAD.EXE"

That's all there is to it.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
RWGBob is offline Offline
2 posts
since Dec 2007
Jun 7th, 2008
0

Re: print to USB from Qbasic

Click to Expand / Collapse  Quote originally posted by RWGBob ...
OPEN "O",1,"PRINT.TMP"
PRINT #1, "Just testing the code."
CLOSE 1
SHELL "C:\PATH\WORDPAD.EXE"

That's all there is to it.
Oops!

SHELL "C:\PATH\WORDPAD.EXE PRINT.TMP"
Reputation Points: 10
Solved Threads: 0
Newbie Poster
RWGBob is offline Offline
2 posts
since Dec 2007
Jun 7th, 2008
0

Re: print to USB from Qbasic

Click to Expand / Collapse  Quote originally posted by RWGBob ...
SHELL "C:\PATH\WORDPAD.EXE"

That's all there is to it.
That's not enough. This way all the printer control codes embedded in the text would end up on paper.
You should create an RTF file for Wordpad instead of a TXT, and translate all the Bold, Condensed and other control codes sent by the Basic program into the corresponding RTF commands.
Regards,
Davide
Reputation Points: 10
Solved Threads: 1
Newbie Poster
printfil is offline Offline
5 posts
since Mar 2008
Jun 23rd, 2008
0

Re: print to USB from Qbasic

Click to Expand / Collapse  Quote originally posted by paul2594 ...
I recently updated my system to XP-2 with a pentium III. I have a number of qbasic programs I developed to use in my hobbies and lo and behold, I can't print to my usb port. The programs run okay. I should think this is a problem that has been solved many times but I haven't run acrossed the answer. Perhaps print-to-file then open and print the file with notepad or something. Any ideas?

Thanks, Paul

reply: Try http://www.brothersoft.com/downloads/dosprint.html

I had the same problem, & this works for me. Good luck. Jack
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Jackgrt is offline Offline
9 posts
since Jun 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Legacy and Other Languages Forum Timeline: MatLab, find area under experimental data plot
Next Thread in Legacy and Other Languages Forum Timeline: batch script to delete directories containing some strings in name





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC