getAllPrinters

getAllPrinters(sa: Array input): Integer updating;

The getAllPrinters method of the Printer class fills an array with the names of the available printers. The return value represents the number of printers in the array.

The array type passed to the method must be an array with a membership of String, to allow the array type to be a HugeStringArray or a StringArray. If another array type with a membership other than String is passed to the method, exception 1000 (Invalid parameter type) is raised.

In JADE thin client mode, this method returns:

When the method is executed in a serverExecution method, it returns the list of printers attached to the server node. When executed in an application server or standard client, the method returns the list of printers visible to the client device.

The following example shows the use of the getAllPrinters method.

load() updating;
vars
    sa : Array;
begin
    // Creates an array and populates it with the currently
    // available printers using the getAllPrinters method. The array
    // is then displayed in a combo box, allowing the user to select
    // a printer.
    create sa transient;
    app.printer.getAllPrinters(sa);
    comboBox.listCollection(sa, false, 0);
    ...                              // do some more processing here
epilog
    // Deletes the transient array object.
    delete sa;
end;