Z-DRIVER

This document covers the following topics:


Description

Load a Con-nect printer profile into the Con-form buffer.

This subprogram can be used before directing a printout to the printer via the COMPOSE FORMATTING statement. The COMPOSE FORMATTING statement then acts upon the information in the Con-form buffer and prints using the printer profile specified by this subprogram.

A previously loaded printer profile is unloaded by either of the following:

  • execution of a COMPOSE RESETTING ALL statement, or

  • formatting a document and sending it to a destination other than a Natural report.

With Z-DRIVER you can optionally call Z-OPSEQ to load the printer open sequence and Z-CLSEQ to load the printer close sequence.

Parameters

Parameter Format In Out Remarks
Return-code N2   X  
Cabinet A8 R   The name of the cabinet which contains the printer profile.
Printer-profile A32 R   The name of the printer profile.

Return Codes

00 Success
02 Invalid cabinet name or - in batch mode only - locked cabinet
83 Invalid printer profile name
84 Requested printer profile does not exist
86 Printer driver module cannot be loaded
90 Printer association not found

Subprograms

Z-110
Z-162
Z-170

Example

0010 DEFINE DATA LOCAL
0020 1 RETURN-CODE     (N2)
0030 1 CABINET         (A8)
0040 1 PRINTER-PROFILE (A32)
0050 1 REPORT-NUMBER   (B1)           /* used by Z-OPSEQ and Z-CLSEQ
0060 END-DEFINE
0070 *
0080 DEFINE PRINTER(1) OUTPUT '289'   /* (1) = report number
0090 FORMAT (1) LS = 120 PS = 60
0100 *
0110 MOVE 1 TO REPORT-NUMBER          /* for Z-OPSEQ and Z-CLSEQ
0120 MOVE 'SYSCNT' TO CABINET
0130 MOVE 'CANON'  TO PRINTER-PROFILE
0140 COMPOSE RESETTING ALL
0150 *
0160 CALLNAT 'Z-DRIVER' RETURN-CODE CABINET PRINTER-PROFILE
0170 IF  RETURN-CODE NE 0
0180     WRITE 'Return code' RETURN-CODE
0190 ELSE
0200     CALLNAT 'Z-OPSEQ' RETURN-CODE CABINET REPORT-NUMBER       /* open
0210        IF RETURN-CODE = 0
0220           COMPOSE FORMATTING INPUT 'Document name'
0230                   FROM CABINET 'Cabinet name'
0240                   OUTPUT(1)
0250           CALLNAT 'Z-CLSEQ' RETURN-CODE CABINET REPORT-NUMBER /* close
0260        ELSE
0270           WRITE 'Invalid report number' RETURN-CODE
0280        END-IF
0280 END-IF
0290 END