Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printing with qbaisc

Status
Not open for further replies.

quebasic2

Programmer
Dec 17, 2002
174
IN
I want my program to print to the computer.
I have been using this:
OPEN "LPT1:BIN" FOR OUTPUT AS #1
PRINT #1, thestring$
CLOSE #1
It works fine, except that after the printer gets through printing, the printer will not spit the paper out, and the light on it starts to blink. How can I fix the error. Also, is there a way to set margins while printing?
 
You need to supply a form feed.

OPEN "LPT1:BIN" FOR OUTPUT AS #1
PRINT #1, thestring$
print #1, chr$(12); 'in most cases
CLOSE #1
David Paulson

 
what do you mean by chr$(12) 'in most cases? Are there other chr$() commands that you must use for some printers?
 
Yes. Not all printers use the same command code. These codes are printer specific, although most seem to follow a type of standard. David Paulson

 
chr$(12) or ^l as it will show in text mode is for a form feed, which will take the paper to the top line of the next page.
Notice that it was followed by a semi-colon. That is to suppress the normal line feed that would normally follow anything dumped.
Some printers have the capability of adjusting form length. In those printers the form feed might result in the paper being at other than the perferation. Ed Fair
Any advice I give is my best judgement based on my interpretation of the facts you supply. Help increase my knowledge by providing some feedback, good or bad, on any advice I have given.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top