RSS Forums RSS
Please support our Legacy and Other Languages advertiser: Programming Forums
Views: 7511 | Replies: 12
Reply
Join Date: Apr 2005
Location: Pacific Northwest
Posts: 2
Reputation: paul2594 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
paul2594 paul2594 is offline Offline
Newbie Poster

News print to USB from Qbasic

  #1  
Apr 27th, 2005
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
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Oct 2004
Posts: 2,546
Reputation: vegaseat will become famous soon enough vegaseat will become famous soon enough 
Rep Power: 11
Solved Threads: 178
Moderator
vegaseat's Avatar
vegaseat vegaseat is offline Offline
DaniWeb's Hypocrite

Solution Re: print to USB from Qbasic

  #2  
May 6th, 2005
You might take a look at
USB Central
http://www.lvr.com/usb.htm

USBs like to use drivers.
May 'the Google' be with you!
Reply With Quote  
Join Date: Apr 2005
Location: Pacific Northwest
Posts: 2
Reputation: paul2594 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
paul2594 paul2594 is offline Offline
Newbie Poster

Re: print to USB from Qbasic

  #3  
May 7th, 2005
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
Reply With Quote  
Join Date: Mar 2008
Posts: 5
Reputation: printfil is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 1
printfil printfil is offline Offline
Newbie Poster

Re: print to USB from Qbasic

  #4  
Mar 22nd, 2008
Dear Paul,
this article might help: How to print from BASIC DOS to any Windows printer
Regards,
Davide
Reply With Quote  
Join Date: Aug 2006
Location: me::house
Posts: 908
Reputation: linux is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 23
linux's Avatar
linux linux is offline Offline
Posting Shark

Re: print to USB from Qbasic

  #5  
Mar 23rd, 2008
You can use LPRINT , can't you?
Toshiba M1151.49 GB DDR-2 RAM1.6 GHz Centrino Duo80GB HDDWindows XP Media Center Edition
Reply With Quote  
Join Date: Mar 2008
Posts: 5
Reputation: printfil is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 1
printfil printfil is offline Offline
Newbie Poster

Re: print to USB from Qbasic

  #6  
Mar 24th, 2008
Originally Posted by linux View Post
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
Reply With Quote  
Join Date: Dec 2007
Posts: 2
Reputation: RWGBob is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
RWGBob RWGBob is offline Offline
Newbie Poster

Re: print to USB from Qbasic

  #7  
Jun 7th, 2008
Originally Posted by paul2594 View Post
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.
Reply With Quote  
Join Date: Dec 2007
Posts: 2
Reputation: RWGBob is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
RWGBob RWGBob is offline Offline
Newbie Poster

Re: print to USB from Qbasic

  #8  
Jun 7th, 2008
Originally Posted by RWGBob View Post
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"
Reply With Quote  
Join Date: Mar 2008
Posts: 5
Reputation: printfil is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 1
printfil printfil is offline Offline
Newbie Poster

Re: print to USB from Qbasic

  #9  
Jun 7th, 2008
Originally Posted by RWGBob View Post
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
Reply With Quote  
Join Date: Jun 2008
Posts: 8
Reputation: Jackgrt is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
Jackgrt Jackgrt is offline Offline
Newbie Poster

Re: print to USB from Qbasic

  #10  
Jun 23rd, 2008
Originally Posted by paul2594 View 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



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

I had the same problem, & this works for me. Good luck. Jack
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 1:16 pm.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC