How to Print to an Apple LaserWriter (20584)



The information in this article applies to:

  • Microsoft QuickBASIC 1.0
  • Microsoft QuickBASIC 1.0a
  • Microsoft QuickBASIC 1.0b
  • Microsoft BASIC Compiler
  • Microsoft BASIC Interpreter for Apple Macintosh 3.0

This article was previously published under Q20584

SUMMARY

To print to the LaserWriter, the LaserWriter and LaserWriter Prep files must be on the Startup disk in the System Folder.

This information applies to Microsoft QuickBASIC Versions 1.00, 1.00a, 1.00b, BASIC Compiler Version 1.00, and BASIC Interpreter Version 3.00 for Apple Macintosh.

MORE INFORMATION

Once you are connected through the AppleTalk network to the printer, select the correct printer in the Chooser. The name of the LaserWriter must be selected and displayed in inverse video in the Chooser printer list so it can print.

If the name of the LaserWriter is not displayed in inverse video, the network is not connected to the LaserWriter. You may receive a "DEVICE I/O ERROR" message at print time right after the "Looking for LaserWriter" message.

If you see a "DEVICE I/O ERROR" message while printing, the network is not properly connected between your Macintosh and the printer. The most likely problem is that a connector wire is loose at some point along the network between your Macintosh and the printer. Tighten all connectors (taping them together if necessary), check the above settings, and print again.

To print a program listing to the LaserWriter, select Print from the BASIC file menu.

To output to the LaserWriter from a BASIC program, open the device "LPT1:" or "LPT1:PROMPT" for output as #n, and use PRINT#n or WRITE#n to output.

WINDOW OUTPUT #n can be used to redirect to the printer what would have gone to the screen. Use PRINT or WRITE instead of PRINT#n or WRITE#n when WINDOW OUTPUT #n is in effect.

Note that LPRINT, LLIST, and output to the device "LPT1:DIRECT," will not send output to the LaserWriter because they provide character mode output and the LaserWriter supports only graphics mode output. You will receive an error message ("FILE NOT FOUND") when attempting to output using LPRINT, LLIST, or "LPT1:DIRECT."

The following is a code sample:
OPEN "LPT1:" FOR OUTPUT AS #1
PRINT #1,"This goes to the laserwriter printer"
WRITE #1,"This goes to the laserwriter printer"
CLOSE #1
				
To use WINDOW OUTPUT #n, do the following:
OPEN "LPT1:" FOR OUTPUT AS #1
WINDOW OUTPUT #1      'Redirects window output to printer
CALL TEXTFONT(4): CALL TEXTSIZE(9)
PRINT "Redirected to printer"
CLOSE #1
				

Modification Type:MinorLast Reviewed:8/16/2005
Keywords:KB20584