Consultor Eletrônico



Kbase P14576: How to display a Printer menu and then print through DOS to
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   22/08/2003
Status: Unverified

GOAL:

How to display a Printer menu and then print through DOS to the selected printer (port)

FIX:

DEF VAR sdriver AS CHAR FORMAT 'x(50)'.
DEF VAR sdevice AS CHAR FORMAT 'x(50)'.
DEF VAR loutput AS CHAR FORMAT 'x(50)'.
DEFINE VARIABLE OK AS LOGICAL NO-UNDO.

run aderb/_prdef.p( output sDriver, output sDevice, output Ok).

SYSTEM-DIALOG PRINTER-SETUP.
ASSIGN loutput = IF sdevice BEGINS 'NE' THEN SESSION:PRINTER-NAME
ELSE SESSION:PRINTER-PORT.
DOS SILENT copy D:\temp\pepe.tmp value(loutput).

/**Where d:\temp\pepe.tmp is the file to copy to the printer port**/
/**We use sdevice because there is a difference between Windows 95/98 and windows NT/2000/XP in what printer-name and printer-port give back**/
/**It works with remote printers too**.