Microsoft KB Archive/39576
Article ID: 39576
Article Last Modified on 11/21/2006
This article was previously published under Q39576
OPENing the "LPT1:PROMPT" device name in a QuickBASIC program prompts you for various print options and Apple ImageWriter printer paper sizes, including the following:
US Letter (8.5 inches by 11 inches)
Mailing Label (1-inch form size)
US Legal (8.5 inches by 14 inches)
Rolodex Card (3-inch form size)
Computer Paper (11-inch form length)
Changing the ImageWriter page size to 1-inch mailing labels or 3-inch Rolodex cards allows printing where a formfeed aligns to the next label or card in a spool. The Mailing Label and Rolodex options are not available to the Apple LaserWriter printer (or versions of Macintosh BASIC prior to QuickBASIC).
You can select your desired printer driver in the Chooser in the Apple menu. The appropriate ImageWriter or LaserWriter driver file must exist in the System Folder.
ResEdit can be used to change the ImageWriter page length. This is explained in "Changing the Print Page Size with PREC" on Pages 156-157 of the "Microsoft QuickBASIC for Apple Macintosh: User's Guide."
To read the "LPT1:PROMPT" settings that are clicked at run time, search for a separate article by querying on the following word:
Note that you cannot suppress the automatic formfeed when the "LPT1:" or "LPT1:PROMPT" device is CLOSEd.
The following is a code example:
ON ERROR GOTO ERHANDLE OPEN "LPT1:PROMPT" FOR OUTPUT AS #1 ' An error occurs on the following statement if you clicked CANCEL ' in the "LPT1:PROMPT" dialog box: PRINT #1,"THIS IS MEANT TO GO TO PRINTER" CLOSE label1: PRINT "This is the end." END ERHANDLE: E = ERR ' assign error number to variable E PRINT "ERROR NUMBER = "; E IF E = 52 THEN PRINT "YOU CLICKED THE CANCEL BUTTON. PRINTING IS CANCELED." END IF RESUME label1 ' Resumes execution at label1. File not opened.
Additional query words: MQuickB