APRINTERS( ) Function

Stores information about currently-available printers into an array.

NoteNote

The behavior of this function is OS (operating system) - specific. Visual FoxPro may or may not check to see if the printers are actually connected to your computer when it prepares this list, and the list may include all printers installed as printer setups, or only those available on the current network.

APRINTERS(ArrayName [, nValue])

Parameters

ArrayName

Specifies the name of the array containing information about printers.

NoteNote

If the array you include does not exist, Visual FoxPro automatically creates the array. If the array exists but is not large enough to contain all the information, Visual FoxPro increases the size of the array to accommodate the information. If the array is larger than necessary, Visual FoxPro truncates the array. If the array exists but APRINTERS( ) returns 0 because no printers are available, the array remains unchanged. If the array does not exist, and APRINTERS( ) returns 0, the array is not created.

[, nValue]

Specifies a value that creates a two-column array or five-column array. Each row in the array contains information about a printer.

The following table describes the possible values of nValue.

nValue Description

0 or omitted

Return a two-column array containing the following items beginning with the first column:

  • Printer name.

  • Name of the port to which the printer is connected.

1

Return a five-column array containing the following items beginning with the first column:

  • Printer name.

  • Name of the port to which the printer is connected.

  • Name of the printer driver.

  • Printer comment.

  • Printer location.

Expand imageReturn Value

Expand imageExample

Expand imageSee Also


© , 1996-2020 • Updated: 11/10/20
Comment or report problem with topic