QBasic command for USB-printer? 
Author Message
 QBasic command for USB-printer?

Hi,

Years ago I wrote a Qbasic program to calculate my monthly expenses. And I
have been able to adapt it from Commodore 64 to Pentium 500. Only now I
connected my printer to the USB-port, and well, that doesn't work of
course. The program gives a LPRINT command, and doesn't find a printer.

Does any of you know if there is a new command to send data to the USB-port
for printing? Or another way to get my data printed?

Thanks for your help,

~~~~~~~~~~~~~~~~~
Marion Schiphorst
http://www.*-*-*.com/
http://www.*-*-*.com/
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



Wed, 18 Dec 2002 03:00:00 GMT  
 QBasic command for USB-printer?
Marion,

You will have to direct the program's output to a file, and then
open that file in a text editor or word processor to print it.

Forget about LPRINT, it seems to be as obsolete as the dinosaurs.

Grnat W.

-----------------------------------------------------------

Got questions?  Get answers over the phone at Keen.com.
Up to 100 minutes free!
http://www.keen.com



Wed, 18 Dec 2002 03:00:00 GMT  
 QBasic command for USB-printer?

Quote:

>Hi,

>Years ago I wrote a Qbasic program to calculate my monthly expenses. And I
>have been able to adapt it from Commodore 64 to Pentium 500. Only now I
>connected my printer to the USB-port, and well, that doesn't work of
>course. The program gives a LPRINT command, and doesn't find a printer.

>Does any of you know if there is a new command to send data to the USB-port
>for printing? Or another way to get my data printed?

Just for the heck of it go into
My Computer
  Control Panel
    Printers
      R-click(your printer)
        Properties
          Details
            Port Settings
              (Uncheck) Spool MS-DOS Print Jobs

and see if that does anything for you.

(let us know one way or the other, please)

C'ya,

--
   ____    _    ____      ____  _____
  |  _ \  / \  / ___) __ | ___)(_   _)     Don Schullian

  |____//_/ \_\(____/\__/|_|     |_|  http://www.DASoftVSS.com
  ___________________________________ http://www.basicguru.com
      Vertical Software Solutions



Wed, 18 Dec 2002 03:00:00 GMT  
 QBasic command for USB-printer?

Quote:

>>Does any of you know if there is a new command to send data to the USB-port
>>for printing? Or another way to get my data printed?
>Just for the heck of it go into
>My Computer
>  Control Panel
>    Printers
>      R-click(your printer)
>        Properties
>          Details
>            Port Settings
>              (Uncheck) Spool MS-DOS Print Jobs

>and see if that does anything for you.

Thanks for your reaction, I tried it, but when I click on 'Port Settings' I
get something (it's in Dutch) like: This port doesn't need any
configuration. I don't even get to see the screen for these settings.

I did see  in the Details screen  under 'Assign Printer Port' that LPT1 is
assigned to the printer.

Any other ideas?

~~~~~~~~~~~~~~~~~
Marion Schiphorst
http://www.schippie.net/
http://www.schippie.net/pictures/
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



Thu, 19 Dec 2002 03:00:00 GMT  
 QBasic command for USB-printer?

Quote:
>Marion,

>You will have to direct the program's output to a file, and then
>open that file in a text editor or word processor to print it.

>Forget about LPRINT, it seems to be as obsolete as the dinosaurs.

I am a dinosaur :-)

Anyway, it has been a long time, and I am not really a wizard at
programming, could you tell me in a few words how to direct the data to a
txt file?
Or is that out of range for this group?

~~~~~~~~~~~~~~~~~
Marion Schiphorst
http://www.schippie.net/
http://www.schippie.net/pictures/
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



Thu, 19 Dec 2002 03:00:00 GMT  
 QBasic command for USB-printer?

Quote:
> Anyway, it has been a long time, and I am not really a wizard at
> programming, could you tell me in a few words how to direct the data to a
> txt file?
> Or is that out of range for this group?

OPEN "sample.txt" FOR OUTPUT AS #1
' Wherever you would use LPRINT, use PRINT #1 instead.
PRINT #1, "My text line 1"
PRINT #1, "My text line 2"
PRINT #1, "My text line 3"
CLOSE #1
OPEN "sample.txt" FOR INPUT AS #1
DO WHILE NOT EOF(1)
    LINE INPUT #1, a$
    PRINT a$
LOOP
CLOSE #1

Tom Lake



Thu, 19 Dec 2002 03:00:00 GMT  
 QBasic command for USB-printer?

Quote:
>OPEN "sample.txt" FOR OUTPUT AS #1
>' Wherever you would use LPRINT, use PRINT #1 instead.
>PRINT #1, "My text line 1"
>PRINT #1, "My text line 2"
>PRINT #1, "My text line 3"
>CLOSE #1
>OPEN "sample.txt" FOR INPUT AS #1
>DO WHILE NOT EOF(1)
>    LINE INPUT #1, a$
>    PRINT a$
>LOOP
>CLOSE #1

Thanks a lot, I'll try that!

~~~~~~~~~~~~~~~~~
Marion Schiphorst
http://www.schippie.net/
http://www.schippie.net/pictures/
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



Thu, 19 Dec 2002 03:00:00 GMT  
 QBasic command for USB-printer?
The problem here is that the printer is connected via a USB port, and
unless you can capture a LPT port and redirect it to the USB port,
*and* the printer supports printing from non-Windows applications, you
are likely to be out of luck.

However, my DOSPRINT utility is designed to solve this problem (along
with a whole bunch of other problems, such as printers that do not
support DOS printing, etc.)

Take a look for yourself at http://www.amerimports.com/dosprint

--Lance
(Author of DOSPRINT and DLLPRINT)

Quote:


>>>Does any of you know if there is a new command to send data to the USB-port
>>>for printing? Or another way to get my data printed?

>>Just for the heck of it go into
>>My Computer
>>  Control Panel
>>    Printers
>>      R-click(your printer)
>>        Properties
>>          Details
>>            Port Settings
>>              (Uncheck) Spool MS-DOS Print Jobs

>>and see if that does anything for you.

>Thanks for your reaction, I tried it, but when I click on 'Port Settings' I
>get something (it's in Dutch) like: This port doesn't need any
>configuration. I don't even get to see the screen for these settings.

>I did see  in the Details screen  under 'Assign Printer Port' that LPT1 is
>assigned to the printer.

>Any other ideas?

>~~~~~~~~~~~~~~~~~
>Marion Schiphorst
>http://www.schippie.net/
>http://www.schippie.net/pictures/
>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



Thu, 19 Dec 2002 03:00:00 GMT  
 QBasic command for USB-printer?


Quote:

>>>Does any of you know if there is a new command to send data to the USB-port
>>>for printing? Or another way to get my data printed?

>>Just for the heck of it go into
>>My Computer
>>  Control Panel

>I did see  in the Details screen  under 'Assign Printer Port' that LPT1 is
>assigned to the printer.

>Any other ideas?

The programs below show two possibilities.  Both avoid the need for an
intermediate text file.  The programs work on my Win 95 system, but
I'm not using a USB printer.

-------------------
OPEN "LPT1" FOR OUTPUT AS #1
PRINT #1, "Printing to LPT1 device"
CLOSE #1
-------------------
OPEN "PRN" FOR OUTPUT AS #1
PRINT #1, "Printing to PRN device"
CLOSE #1
-------------------

They are presented as separate programs because if Qbasic causes an
error trying to print to the LPT1 device, the program will stop before
it has the chance to try printing to the PRN device.

The help screen in Qbasic for LPRINT says:

        LPRINT prints data on the printer LPT1.

Maybe this isn't the whole story when USB ports are used?

USB= universal _serial_ bus

LPT1 is a parallel port.  There may be some driver doing
parallel/serial conversions.  Maybe it doesn't behave in a way that
QBasic expects?  Perhaps bypassing Qbasic's translation from LPRINT to
LPT1 -- and talking to LPT1 directly -- will work.

The PRN device is usually assigned to the printer, too, but maybe USB
printers are configured differently.

Does the Control Panel show that there is a COM port assigned to the
printer, too, since it is on a _serial_ bus?  If so, maybe there is a
way to send output to directly to the printer via a COM port.

Joe Geluso



Thu, 19 Dec 2002 03:00:00 GMT  
 QBasic command for USB-printer?

Quote:
> Does any of you know if there is a new command to send data to the USB-port
> for printing? Or another way to get my data printed?

You can get any port hex (for use with OUT, INP, CALL INTERUPT, etc.)
this way:
Start
 Settings
  Control Panel
   System
    Device manager
     (Chose a device)
      Properties
       Resources
        (!And here it is!)

You can use this for any device; from acelerator cards to internal
speakers and they are same for most similar computers.

Good luck!



Fri, 20 Dec 2002 03:00:00 GMT  
 QBasic command for USB-printer?


Quote:
> Hi,

> Does any of you know if there is a new command to send data to the
USB-port
> for printing? Or another way to get my data printed?

I wrote two articles about that so please check them out:

http://dreael.catty.ch/Deutsch/BASIC-Knowhow-Ecke/BildschirmHardcopy....

This article discusses ways in general how to print graphical data,
typically a screen hardcopy.

http://dreael.catty.ch/Deutsch/BASIC-Knowhow-Ecke/BASICunterWindows95....
html

This article discusses the detail how to succesfully use QuickBASIC inside
the today's 32 bit operating systems like Windows 95/98/NT.

Note, that I'm still working on this brand new BASIC knowhow Web site, an
English and French translation will follow later, so please use
http://babelfish.altavista.com/translate.dyn at the moment if you don't
speak German.

     Greetings from Switzerland

             Andreas



Sat, 21 Dec 2002 03:00:00 GMT  
 
 [ 11 post ] 

 Relevant Pages 

1. Sending Printer Commands to Printer using QBASIC

2. USB Printer (Plotter) and the printer.print statement

3. getting a qbasic program to run the command to start another non qbasic

4. Help, How to send printer command to printer bypassing printer driver in vb

5. VB3 and USB Printers

6. Problem with VB3 & USB printer

7. Coding for output to USB printer port

8. VB3 and printing to a USB printer

9. OpenPrinter/WritePrinter not working for USB printers

10. USB printer

11. Same code on usb thumbdrive slower than usb ext drive

12. how to send printer commands to a printer

 

 
Powered by phpBB® Forum Software