PtrDevice:GetPrinters() Method

<< Click to Display Table of Contents >>

Navigation:  RpPrinter & PtrDevice Class Overview > PtrDevice Class >

PtrDevice:GetPrinters() Method

Previous pageReturn to chapter overviewNext page


To retrieve a list of installed printers.


<oPtrDevice>:GetPrinters() aPrinters                                (ARRAY)


This method retrieves the installed printers.  The printers are returned in a two dimensional array structured as follows:


         aPrinters[x,1] = Printer Name                ("HP LaserJet II")

         aPrinters[x,2] = Device Driver                ("HPPCL")

         aPrinters[x,3] = Port                                ("LPT1:")


If the method fails, an empty array is returned.


// ? the installed printers

aPrinters := oPtrDevice:GetPrinters()

for nLp := 1 to alen(aPrinters)

         ? aPrinters[nLp,1]

next nLp