Progress
Report Builder
Deployment Guide


Listing the Available Printers

You can generate a list of available printers and ports from the Progress 4GL by using the aderb/_prlist.p procedure.

Use the following command in the Progress 4GL application:

RUN aderb/_prlist.p (OUTPUT printer-list, OUTPUT port-list, 
      OUTPUT printer-count) 

The following list describes the arguments for the _prlist.p procedure:

printer-list

The character variable that will receive the printer names as a comma-separated list.

port-list

The character variable that will receive the port names as a comma-separated list.

printer-count

The integer variable that counts the number of printers.

For example, run the printlst.p procedure:

printlst.p
/* 1 */ 
  DEF VAR printer-list AS CHARACTER NO-UNDO.
  DEF VAR port-list AS CHARACTER NO-UNDO.
  DEF VAR i AS INTEGER NO-UNDO.
  DEF VAR printer-count AS INTEGER NO-UNDO.
  DEF VAR printer AS CHARACTER NO-UNDO FORMAT "x(32)".
  DEF VAR port AS CHARACTER NO-UNDO FORMAT "x(20)".

/* 2 */ 
  RUN aderb/_prlist.p (OUTPUT printer-list, OUTPUT port-list,
    OUTPUT printer-count).

/* 3 */ 
  REPEAT i = 1 TO printer-count:
    printer = entry (i, printer-list).
    port = entry (i, port-list).
  DISPLAY i ")" printer port.
  END.

  PAUSE. 

The commented numbers correspond to the following step-by-step descriptions:

  1. Define the variables that will display the printer and port names and the number of printers.
  2. Call the _prlist.p procedure and specify the printer, port, and printer count variables.
  3. Display each of the printers and ports.

Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095