List the printer drivers installed on the PC.
Syntax
CHGVAR VAR(&CMD) VALUE('ENUMPRT')
CHGVAR VAR(&PARM1) VALUE('
[ First=True / False ]
[; NameOnly=True / False ]
[; Close=True ; False ] ')
CHGVAR VAR(&PARM2) VALUE(' ')
CALL PGM(LNCCMD) PARM(&HANDLE &CMD &OPT &PARM1 +
&PARM2 &RESULT)
Parameters
Parameters |
|
Parm1 |
First : True, to initialize the list process, and receive the description for the first printer. If
First is false, &RESULT will contain the description of the next
printer. NameOnly :
If NameOnly is true, variable &RESULT will only contain the name
of the printer driver. Printer="Printer
name";Server="Server name" Close :
True to end the list process. |
RESULT |
On output, parameter &RESULT contains : • *NONE if the last printer was listed. •
The
description of a printer. Format depends on the value of the NameOnly keyword. |
Example
PGM
DCL VAR(&RES) TYPE(*CHAR) LEN(2000)
DCL VAR(&OPT) TYPE(*CHAR) LEN(1)
DCL VAR(&RES2) TYPE(*CHAR) LEN(2000)
DCL VAR(&HDL) TYPE(*CHAR) LEN(100) VALUE('*ONLY ')
DCL VAR(&PARM1) TYPE(*CHAR) LEN(512)
DCL VAR(&PARM2) TYPE(*CHAR) LEN(1024)
LNCOPEN
CHGVAR VAR(&PARM1) VALUE('FIRST=TRUE')
CALL PGM(LNCCMD) PARM(&HDL 'ENUMPRT' &OPT &PARM1 +
&PARM2 &RES)
CHGVAR VAR(&PARM1) VALUE('FIRST=FALSE')
DOWHILE COND(&RES *NE '*NONE')
CALL PGM(LNCCMD) PARM(&HDL 'ENUMPRT' &OPT &PARM1 +
&PARM2 &RES)
ENDDO
LNCCLOSE
ENDPGM