The APRINTERS function allows you to enumerate all the printers to which your application can print.

 

 

?"Printer info"

ShowPrinters(0)

?"More printer info"

ShowPrinters(1)

PROCEDURE ShowPrinters(nMode)

      n=APRINTERS(aa,nMode)

      FOR i= 1 TO n

            ?i

            FOR j = 1 TO ALEN(aa,2)

                  ??"---",aa[i,j]

            ENDFOR

      ENDFOR

RETURN

 

 

 

 

Likewise, the ANETRESOURCES function lets you learn what resources are available on the network (see WNetEnumResource), such as available network shares and network printers.

 

 

On my machine, this code

 

cMachine=""

n=ANETRESOURCES(aa,cMachine,1)

FOR i= 1 TO n

      ?i,aa[i]

ENDFOR

 

Produces this output

 

         1 Microsoft Terminal Services

         2 Microsoft Windows Network 

         3 Web Client Network

 

Change the machine name to a machine on your network.