Device 2 Details

Top  Previous  Next

The device channel 2 provides access to any attached or networked printer on your computer.

 

Initialization.

 

OpenI. Using the OpenI intrinsic on device 2 causes the program to display the standard printer configuration dialog box that lets you select and configure a printer for output. If the user presses the Cancel button, EXPL will generate an I/O error that can be trapped to abort the print operation.

 

OpenO. Using the OpenO intrinsic on device 2 flushes its output buffer and opens a channel to the currently selected printer.

 

Output. Any output to device 2 sends characters to the printer buffer. For example, Text(2,"Hello World") sends the string "Hello World" to the print buffer. Printing doesn't begin until the print channel is closed. The output routines handle carriage returns, line feeds, tabs and form feeds.

 

Close. The Close intrinsic sends any accumulated text in the output buffer to the printer and closes the printer.

 

Click here for an example printing program.