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_psqlist( <cprintserver>, <nprinter> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
N_PSQLIST( <cPrintServer>, <nPrinter> 
        [, <aQueues> [, <aServers> ] ] )


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:

nPrinter = N_PSPNO('PS1', 'LASER3')
N_PSQLIST( , nPrinter, aQs)


<nPrinter>
Printer number. Numbering starts with zero. The first network printer 
is 0.

<aQueues>
Array to receive a list of print queue names. Queue names are prefixed 
with the name of the file server on which the queue resides.

<aServers>
Array to receive a list of file servers corresponding to the queue
names in <aQueues>. The array <aServers> should be the same size as the 
array <aQueues>.


Returns

The number of queues serviced by the printer. You can use the return 
value to size the arrays <aQueues> and <aServers>, which you can pass 
in a second call to N_PSQLIST().

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


Description

Stores a list of queues serviced by the printer in the array passed as 
<aQueues> and, optionally, a corresponding array of servers in the 
array passed as <aServers>.


Example

/* Display a menu of print queues and return the
   name of the queue selected.
*/
FUNCTION SelectQueue( nTop, nLeft, nBottom, nRight, ;
                      cColor, cPServer, nPrinter    )
   LOCAL cScreen, nChoice, cQueue
   LOCAL cOldColor := SETCOLOR(cColor)
   LOCAL aQueues := {}
   cScreen = SAVESCREEN(nTop, nLeft, nBottom, nRight)
   @ nTop, nLeft TO cBottom, nRight DOUBLE
   N_PSQLIST(cPServer, nPrinter, aQueues)
   nChoice = ACHOICE(nTop + 1, nLeft + 1, ;
                     nBottom - 1, nRight - 1, aQueues)
   RESTSCREEN(nTop - 1, nLeft - 1, ;
              nBottom + 1, nRight + 1, cScreen)
   SETCOLOR(cOldColor)
   IF nChoice > 0
      cQueue = aQueues[nChoice]
   ENDIF
RETURN cQueue



See Also: N_PSPLIST() N_QJLIST()

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