Page 1 of 1

Can we print using Qbasic

Posted: Fri Sep 03, 2004 8:42 am
by Guest
Can weget Qbasic to print using a printer? If we can how?

Posted: Fri Sep 03, 2004 9:00 am
by Pete
Yes, using the LPRINT command, though I think this is limited to printers connected to your computer through the parallel (LPT1) port.

LPRINT works just like PRINT. For example,

Code: Select all

LPRINT "Hello, how are you today?"
will print Hello, how are you today? on your paper.

As far as printing graphics and colors, I can't remember how to do it... and I'm not even sure if you can. Maybe one of these other nice people can fill us both in?

Posted: Sat Sep 04, 2004 9:18 am
by Anonymous
Pete wrote:As far as printing graphics and colors, I can't remember how to do it... and I'm not even sure if you can. Maybe one of these other nice people can fill us both in?
Printing graphics and colors requires you to know the escape codes of your printers manufacturer. Try to find them using google, then you can send these escape commands to the printer (using LPRINT as well, I thought) and it will execute the commands.

The commands differ per printer however, so if you want to make a program that prints out graphics, note that only your printer and similar printers will be able to print, other printers will either print random garbage or returns errors.

Colour printing

Posted: Wed Sep 29, 2004 12:48 am
by abionnnn
I had an example ages ago that did it for IBM-compatible printers. These are rare to find now, but it's quite similiar these days.

It'll be hard to make it portable unfortunatly since every printer manufacturer likes to make unstandardised crap. Maybe if you found out how to put various printers in postscript mode (if it existed) you'd have some luck =P

-abionnnn