PRINTER NAME

PRINTER NAME

Top  Previous  Next

 

The PRINTER NAME statement associates a named printer device with a print unit.

 

 

Format

 

PRINTER NAME {ON print.unit} printer.name

{ON ERROR statement(s)}

{THEN statement(s)}

{ELSE statement(s)}

 

where

 

print.unit evaluates to the print unit on which the action is be to performed. If omitted, the default print unit (unit 0) is used.

 

printer.nameevaluates to a printer name.

 

statement(s)are statements to be executed depending on the outcome of the operation.

 

The ON ERROR, THEN and ELSE clauses are all optional.

 

 

The ON ERROR clause is executed in the event of a fatal internal error. The error code returned by the STATUS() function will indicate the cause of the error. If this clause is omitted, the program will abort in the event of a fatal error.

 

The THEN clause is executed if the operation is successful. The STATUS() function will return zero.

 

The ELSE clause is executed if the printer does not exist. If this clause is omitted, program execution continues after an error.

 

 

Example

 

PRINTER NAME ON 1 "LPT1"

 

This statement directs output from print unit 1 to a printer named LPT1.