Microsoft KB Archive/28982

= No LPRINT, LLIST, &quot;LPT1: DIRECT&quot; Allowed in AppleTalk Network =

Article ID: 28982

Article Last Modified on 11/21/2006

-

APPLIES TO


 * Microsoft QuickBasic 1.0
 * Microsoft BASIC Compiler 6.0b
 * Microsoft BASIC Interpreter 2.0
 * Microsoft BASIC Interpreter 2.1 for Macintosh
 * Microsoft BASIC Interpreter 3.0 for Macintosh

-



This article was previously published under Q28982



SUMMARY
This information applies to Microsoft QuickBASIC Version 1.00, Microsoft BASIC Compiler Version 1.00, and Microsoft BASIC Interpreter Versions 2.00, 2.10, and 3.00 for the Apple Macintosh.

Macintosh BASIC does not support LPRINT, LLIST, or output to the device &quot;LPT1:DIRECT&quot; over the AppleTalk network. BASIC can only send graphics mode output over the network. BASIC cannot send character mode output over the network.

To output from BASIC to a printer through the AppleTalk network, output to the &quot;LPT1:&quot; or &quot;LPT1:PROMPT&quot; device name. Select Printer Chooser from the Apple menu.

To print a program listing over the AppleTalk Network, select Print from the File menu instead of using LLIST.

Note that you must have the BASIC interpreter Version 3.00, the BASIC compiler Version 1.00, or QuickBASIC Version 1.00 to output to the Apple LaserWriter printer. The BASIC interpreter Versions 1.00, 1.01, 2.00, and 2.10 cannot output to the Apple LaserWriter.



MORE INFORMATION
To output to a printer on the AppleTalk Network, OPEN the device &quot;LPT1:&quot; or &quot;LPT1:PROMPT&quot; FOR OUTPUT AS #n and use PRINT#n or WRITE#n to output (where n is any arbitrary file number between 1 and 255).

WINDOW OUTPUT #n can be used to redirect to the printer what would have gone to the screen. However, PRINT and WRITE statements must be used instead of PRINT#n or WRITE#n when WINDOW OUTPUT #n redirection is in effect. The WINDOW OUTPUT #n redirection ends as soon as you perform CLOSE#n or a general CLOSE.

Code Examples

To open the device &quot;LPT1:&quot; or &quot;LPT1:PROMPT&quot; for output, use the following: OPEN &quot;LPT1:PROMPT&quot; FOR OUTPUT AS #1 PRINT #1,&quot;This goes to the networked printer&quot; WRITE #1,&quot;This goes to the networked printer&quot; CLOSE #1 To use WINDOW OUTPUT #n to redirect window output to the printer, use the following: OPEN &quot;LPT1:PROMPT&quot; FOR OUTPUT AS #1 WINDOW OUTPUT #1 CALL TEXTFONT(4) : CALL TEXTSIZE(9) PRINT &quot;MONACO FONT REDIRECTED FROM SCREEN TO PRINTER&quot; LINE (20,20)-(50,50)   ' This drawn line goes to the printer. CLOSE #1

Additional query words: BasicCom MQuickB

Keywords: KB28982

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.