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_psset( <cprintserver>, <nprinter>, http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
N_PSSET( <cPrintServer>, <nPrinter>, 
         <cAttribute1>|<nAttribute1>, <Setting1>
      [, <cAttribute2>|<nAttribute2>, <Setting2>... ] )
-- or --
N_PSSET( <nPrinter>, <aAttribute>, <aSetting> )


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_PSGET('PSERVER0', 0, ...)
N_PSSET( , 0, ...)

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

<cAttribute> -- or -- <nAttribute>
Attribute to set. May be passed as a text string or as a numeric value. 
See the table below for a list of printer attributes that may be set.

<Setting>
Value to which the attribute should be set.

<aAttribute>
An array containing the names or numbers of the attributes you wish to 
set. This is an alternative to passing a series of <Attribute>, 
<Setting> pairs.

<aSetting>
An array of values for the attributes listed in the corresponding array 
<aAttribute>.

The number of elements in <aSetting> must be equal to or greater than 
the number of elements in <aAttribute>, or attributes may be set to 
unintended values.

Clipper 5.x  If <aSetting> is initialized to zero elements, the 
function will automatically set it to the correct resize.


Returns

Zero if all attributes passed to the function were set. Otherwise,
the function returns a number corresponding to the position in the
argument list of the first item that caused the failure.

For example, if you attempt to set only one attribute and pass an
incorrect attribute name, the function will return 2. This indicates
that the second argument caused the failure. On the other hand, if
the attribute name is incorrect but the setting is invalid, the function
will return 3, indicating that the third argument caused the failure.


Description

Sets the attributes of the specified printer to the indicated values. 
You can include as many attribute/value pairs as needed. 

Setting multiple attributes in a single call is more efficient than 
repeated calls to N_PSSET().

Attributes may be specified by name or number. Attribute numbers are 
defined as manifest constants in PSERVER.CH. Using numbers or constants 
will give slightly better performance than using names.

The attributes listed below may be changed.

Text          #define             Attribute
COMMAND       PS_COMMAND          Printer command
FORMNO        PS_FORMNO           Currently mounted form

Data types and valid settings for the attributes are given below.

COMMAND
String. Printer command is accepted by N_PSSET() but not by N_PSGET(). 
You may set it to one of the following characters:

Literal       #define             Meaning
C             PS_CANCEL           Cancel print job (throw away)
E             PS_EJECT            Eject page
H             PS_HOLD             Hold print job (place back in queue)
M             PS_MARK             Mark form
P             PS_PAUSE            Pause printer
R             PS_REWIND           Restart from the beginning. 
                                  See N_PSREWIND().
S             PS_START            Start printer

The command attribute can be repeated in order to perform several 
operations together. For example, either of these lines of code will 
eject a page and start the printer:

N_PSSET('PS1', 0, 'COMMAND', 'E', 'COMMAND', 'S')
-- or --
N_PSSET('PS1', 0, PS_COMMAND, PS_EJECT, ;
                  PS_COMMAND, PS_START  )

FORMNO
Numeric. Also referred to as Print Class or Form Type. The number of 
the form to mount on the specified printer. This generally, but not 
necessarily, corresponds to a PRINTDEF form number.

When a print server is loaded, it normally begins printing jobs of 
print class zero. If a job is queued with another print class, the 
print server will pause, broadcast a message requesting that the 
appropriate form be mounted, and will not proceed until the user or 
operator responds that the form has been mounted. Use this attribute to 
inform the print server that the requested form has been mounted.


Example

// Press <ESC> to cancel last print job
#include 'PSERVER.CH'
IF LASTKEY() = 27
  N_PSSET('PRINTQ_0', 0, PS_COMMAND, PS_CANCEL)
ENDIF


Files

PSERVER.CH



See Also: N_PSGET() N_PSREWIND()

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