[Home]  [Edit this page]  [Recent Changes]  [Special Pages]  [Help
QbasicFAQ_PrintControlCodes
What are Printer control Codes?


Back to QBasic FAQ Main Page.

Printer control codes, are used to pass information to control the printer, and not actually print. An example of the simplest control code is CHR$(7), defined as BELL. (From when printers actually had a bell and not a speaker.) Sending just the plain character 7 to the printer will cause the printer will emit a beep.

Two more common codes are CHR$(12) and CHR$(13), these are Page Feed and Carriage Return. Sending just the [character]] 12 will eject a loaded page, where you can use 13 to index one line and return the print position to home.

REMEMBER to always use a semi-colon (;) after sending the control code, because by default, QB will send a CHR$(13) after any LPRINT statement that does not have a semi-colon after it.

last edited (December 9, 2002) by KDivad Leahcim, Number of views: 2399, Current Rev: 2 (Diff)

[Edit this page]  [Page history]  [What links here]  [Discuss this topic]  [Printer Friendly]  

Members

Username:

Password:


Register
Forgot Password?




Programmers Heaven - for .NET, Java, C/C++ and WEB Developers!
© 1996-2008 Community Networks Ltd. All rights reserved. Reproduction in whole or in part, in any form or medium without express written permission is prohibited. Violators of this policy may be subject to legal action. Please read Terms Of Use and Privacy Statement for more information. Development by Tore Nestenius at .NET Consultant - Synchron Data.