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_b_members( <cobject>, <ntype>, <cproperty> [ , <anames> [, <atypes> ] ] ) http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
N_B_MEMBERS( <cObject>, <nType>, <cProperty> [ , <aNames> [, <aTypes> ] ] )


Parameters

<cObject>
Name of an object.

<nType>
Object type.

<cProperty>
Name of a set property of the object.

<aNames>
Array to receive names of members of the set.

<aTypes>
Array to receive object types corresponding to the object names in 
<aNames>. The array <aTypes> must be at least the size of the 
corresponding array <aNames>. If it has fewer elements than <aNames>, 
trailing values will be lost.


Returns

Number of set members.

Call N_B_MEMBERS(<cObject>, <nType>, <cProperty>) to properly size the 
array <aNames> before passing it as the fourth parameter in a second 
call to N_B_MEMBERS().

Clipper 5.x  If you initialize <aNames> and<aTypes> to zero 
elements, the function will resize the arrays when you pass them as the 
fourth and fifth parameters. Thus you need make only one call, not two. 
For instance:

LOCAL aMembers := aTypes := {}
N_B_MEMBERS('PQ_1',3,'Q_USERS',aMembers,aTypes)


Description

N_B_MEMBERS(<cObject>,<nType>,<cProperty>, <aNames>)fills the array 
<aNames> with the names of members of the set property <cProperty>.

Object types and commonly used set properties are listed below.

Object Types
Value      Object type
 1         User
 2         Group
 3         Print queue
 4         File server
 6         Gateway
 7         Print server
38         Remote bridge

Set Properties
Name                    Owner     Member
GROUPS_I'M_IN           User      Groups an object
                                  belongs to.
                                  Usually attached
                                  to user or group
                                  objects.

GROUP_MEMBERS           Group     Members of a
                                  user group.
                                  Usually attached 
                                  to group
                                  objects.

                                  Note that for
                                  every entry 
                                  in a
                                  GROUP_MEMBERS 
                                  set, there is a
                                  corresponding
                                  entry in a 
                                  GROUPS_I'M_IN
                                  set.

Q_OPERATORS             Prt queue User/group who
                                  can reorder or
                                  delete  any job
                                  in the queue.

Q_SERVERS               Prt queue Print server
                                  that can 
                                  service jobs in
                                  the queue.

Q_USERS                 Prt queue User/group who
                                  can place jobs
                                  in the queue. 
                                  Usually
                                  EVERYONE.

SECURITY_EQUALS         User      User/group with
                                  same security
                                  level.

OPERATORS               File srvr Console
                                  operators.


Examples

// Display all members of Group 'SALES'
DECLARE aMembers[N_B_MEMBERS('SALES', 2, 'GROUP_MEMBERS')]
N_B_MEMBERS('SALES', 2, 'GROUP_MEMBERS', aMembers)
ACHOICE(nTop, nLeft, nBottom, nRight, aMembers)

// Display all users who have Supervisor security access
LOCAL aSuper := {} // Clipper 5.x
N_B_MEMBERS('SUPERVISOR', 1, 'SECURITY_EQUALS', aSuper)
ACHOICE(nTop, nLeft, nBottom, nRight, aSuper)



See Also: N_B_ISMEMBER() N_B_PRTYPE()

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