APRINTERS( ) Function Example

The following example uses APRINTERS( ) to create an array named gaPrinters that contains the names and ports of installed printers. The printers and their ports are then displayed. If no printer is installed, a message is displayed.

IF APRINTERS(gaPrinters) > 0  && If there are installed printer drivers
   CLEAR  && Clear the main Visual FoxPro window
   DISPLAY MEMORY LIKE gaPrinters && Display the printers and ports
ELSE  && Otherwise, no printer are installed
   WAIT WINDOW 'No printers installed.'
ENDIF