Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- NetLib for Clipper, Version 6.0 - n_psplist( <cprintserver>, <cqueue> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
N_PSPLIST( <cPrintServer>, <cQueue> 
        [, <aPrinters> [, <aPrinterNames> ] ] )


Parameters

<cPrintServer>
Name of the print server.

NetLib will remember the argument to <cPrintServer> specified in the 
last call to one of the N_PS* functions. You can then pass NIL as the 
argument, and NetLib will assume you mean the same print server as 
before. If no print server has yet been specified, NIL will represent 
the first or only print server defined in the system. Thus this 
sequence is permissible:

N_PSPLIST('PS0', 'PRINTQ_0', aPrtr)
N_PSSET( , aPrtr[1], ...)

<cQueue>
Print queue name.

<aPrinters>
Array to receive a list of printer numbers serviced by the queue.

<aPrinterNames>
Array to receive a list of printer names corresponding to printer 
numbers in <aPrinters>. The number of elements in <aPrinterNames> must 
be equal to or greater than the number of elements in <aPrinters>, or 
trailing values will be lost.

Clipper 5.x  If the arrays <aPrinters> and <aPrinterNames> are 
initialized to zero elements, the function will resize them correctly.


Returns

The number of printers serviced by the queue. You can use the return 
value to size the array <aPrinters>, which you can then pass in a 
second call to N_PSPLIST().


Description

Stores a list of printer numbers (and, optionally, printer names) 
servicing a queue into an array. This is useful if a queue is being 
serviced by several printers.


Example

/* Display a menu showing printer numbers and
   return the number of the printer selected.
*/
FUNCTION SelectPrinter( nTop, nLeft, nBottom, nRight, ;
                        cColor, cPServer, cQueue      )
   LOCAL cScreen, nChoice, nPrinter
   LOCAL cOldColor := SETCOLOR(cColor)
   LOCAL aPrinters := {}
   cScreen = SAVESCREEN(nTop, nLeft, nBottom, nRight)
   @ nTop, nLeft TO cBottom, nRight DOUBLE
   N_PSPLIST(cPServer, cQueue, aPrinters)
   nChoice = ACHOICE(nTop + 1, nLeft + 1, ;
                     nBottom - 1, nRight - 1, aPrinters)
   RESTSCREEN(nTop - 1, nLeft - 1, ;
              nBottom + 1, nRight + 1, cScreen)
   SETCOLOR(cOldColor)
   IF nChoice > 0
      nPrinter = aPrinters[nChoice]
   ENDIF
RETURN nPrinter



See Also: N_PSQLIST() N_QJLIST()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson