DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   Legacy and Other Languages (http://www.daniweb.com/forums/forum42.html)
-   -   print to USB from Qbasic (http://www.daniweb.com/forums/thread22636.html)

paul2594 Apr 27th, 2005 4:26 am
print to USB from Qbasic
 
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

vegaseat May 6th, 2005 11:09 pm
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.

paul2594 May 7th, 2005 6:44 am
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

printfil Mar 22nd, 2008 8:20 am
Re: print to USB from Qbasic
 
Dear Paul,
this article might help: How to print from BASIC DOS to any Windows printer
Regards,
Davide

linux Mar 23rd, 2008 2:39 pm
Re: print to USB from Qbasic
 
You can use
LPRINT
, can't you?

printfil Mar 24th, 2008 9:09 am
Re: print to USB from Qbasic
 
Quote:

Originally Posted by linux (Post 567430)
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

RWGBob Jun 7th, 2008 1:27 pm
Re: print to USB from Qbasic
 
Quote:

Originally Posted by paul2594 (Post 118867)
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.

RWGBob Jun 7th, 2008 1:28 pm
Re: print to USB from Qbasic
 
Quote:

Originally Posted by RWGBob (Post 622789)
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"

printfil Jun 7th, 2008 2:52 pm
Re: print to USB from Qbasic
 
Quote:

Originally Posted by RWGBob (Post 622789)
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

Jackgrt Jun 23rd, 2008 11:53 pm
Re: print to USB from Qbasic
 
Quote:

Originally Posted by paul2594 (Post 115814)
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


All times are GMT -4. The time now is 6:37 pm.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC