Qbasicnews.com

Full Version: Printer
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I used Basic back in the 80's. I got out of the habit, but now I am trying to re-learn.

One question: Why does it take so long for anything sent to the printer to finally print? If I go to file>print to print my program lines, it takes any where from 5 to 20 minutes for the printer to start printing. The same thing with "running" the program when the results will go to the printer.

I have the printer set not to spool the jobs. I use a HP Deskjet printer. (parallel; LP1) Could it be that I use Windows XP?

Thanks for your help!
Yes I'd say it has to do with you using winXP

If you want to print out your program I recommend opening it in notepad and printing it from there.

I don't really see a use in printing to a printer -from- QB anymore... *shrugs*


I could be wrong. Just my thoughts.
Thanks for the reply!

So no one uses QB as a database or a check book program (for example) and the lprint to the printer the results of a search or to print their reconciled check book.

I figured I could print just the source code thru a text file and notepad, but was just wondering about the other. Guess I'm still living in the old days (LOL).
I've had trouble printing directly to the LPT1 printer with QB running under Windows XP. Since I couldn't figure out why, I changed the program to do PRINT # to an output .txt file instead of doing LPRINT.

When the program finishes, you can load the .txt file into Notepad and print it out with no problem, and it looks the same as if you printed it from QB. This also gives you the option of loading it into Word and making the printout a little more "pretty".
*****
Two comments about using print # and notepad:

-You can launch notepad just to print and have it closed automatically with notepad /p yourfile.

-Notepad does not use the same character set as QB, so don't use it for printing chars outside the range 32-128 or you will get weird results.
securityman:

If you want to print "instantly" from within any BASIC, including QuickBASIC, try this little program:

Code:
LPRINT "This will print out when the program reaches line 20."
LPRINT "In fact, everything that has been sent to the printer"
LPRINT "with LPRINT before line 20 will print out at that point."
20 LPRINT CHR$(12) 'Character 20 is the ASCII code for FORM FEED"
Quote:securityman:

If you want to print "instantly" from within any BASIC, including QuickBASIC, try this little program:

Code:
LPRINT "This will print out when the program reaches line 20."
LPRINT "In fact, everything that has been sent to the printer"
LPRINT "with LPRINT before line 20 will print out at that point."
20 LPRINT CHR$(12) 'Character 20 is the ASCII code for FORM FEED"
I think you missed the initial point. He's having problems using LPRINT on his Windows XP machine. So, your LPRINT solution is not gonna work for him.
*****
I guess I'm just thick-skulled!

I HAVE Windows Xp with Service Pack 2 on my machine.

I thought he was having trouble printing out to his printer from within QuickBASIC.

Moneo, you said:
Quote:I've had trouble printing directly to the LPT1 printer with QB running under Windows XP. Since I couldn't figure out why, I changed the program to do PRINT # to an output .txt file instead of doing LPRINT.
So, it seemed to me that the problem was just that, printing to the printer within QB running under Windows XP.

If the above is the case, my little demonstration program for LPRINT and CHR$(12) should work. Have you tried it?
Quote:..... my little demonstration program for LPRINT and CHR$(12) should work. Have you tried it?
Sorry, Ralph, I don't have a printer connected to the PC that I'm using, so I can't actually test it. Maybe someone else can try it.
*****
I would not rely on DOS printing - It works well with old dot matrix printers, but not every modern laser or ink-bubble printer will support the old codes; most of them can't even be accessed from DOS.
Pages: 1 2