home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1993 #2 / Image.iso / clipper / nettos11.zip / BINDERY / ISINSET.PRG < prev    next >
Text File  |  1993-02-23  |  3KB  |  114 lines

  1. /*
  2.  * File......: ISINSET.PRG
  3.  * Author....: Kevin Maher/Steve Tyrakowski
  4.  * CIS ID....: 73766,1224
  5.  * Date......: $Date$
  6.  * Revision..: $Revision$
  7.  * Log file..: $Logfile$
  8.  * 
  9.  * This is an original work by Kevin Maher and Steve Tyrakowski
  10.  * and is placed in the public domain.
  11.  *
  12.  * Modification history:
  13.  * ---------------------
  14.  *
  15.  * $Log$
  16.  *
  17.  */
  18.  
  19.  
  20. /*  $DOC$
  21.  *  $FUNCNAME$
  22.  *     FN_bndOInS()
  23.  *  $CATEGORY$
  24.  *     Bindery
  25.  *  $ONELINER$
  26.  *     Is Bindery Object In Set
  27.  *  $SYNTAX$
  28.  *
  29.  *     FN_bndOInS(cOwnerName, nOwnerType, cProperty, cMemberName, nMemberType  )
  30.  *           => lIsInSet
  31.  *
  32.  *  $ARGUMENTS$
  33.  *
  34.  *     <cOwnerName> is the name of the Bindery Object that owns the SET
  35.  *         property you are going to search.  Max Length = 47
  36.  *
  37.  *     <nOwnerType> is the Object Type for <cOwnerName>.  Manifest constants
  38.  *           describing the defined types are included in the NETTO.CH
  39.  *           header file.
  40.  *
  41.  *     <cProperty> is the string containing the name of the <cOwnerName>'s
  42.  *           SET property that you wan to search.  Max Length = 15
  43.  *
  44.  *     <cMemberName> Bindery Object Name that you want to find in the
  45.  *           <cProperty>  SET.   Max Length = 47
  46.  *
  47.  *     <nMemberType> is the Object Type for <cMemberName>.  Manifest
  48.  *             constants describing the defined types are included 
  49.  *             in the NETTO.CH header file.
  50.  *
  51.  *  $RETURNS$
  52.  *
  53.  *     <lIsInSet> Logical if cMemberName is included in the SET property.
  54.  *
  55.  *  $DESCRIPTION$
  56.  *
  57.  *     This function determines if a bindery object is a member
  58.  *     of a SET property.  If the object is not in the set,
  59.  *     or an error occurs, false is returned.
  60.  *
  61.  *  $EXAMPLES$
  62.  *
  63.  *     // This example determines if Group EVERYONE is
  64.  *     // one of STEVE's  GROUPS_I'M_IN set members
  65.  *
  66.  *     lInSet := FN_bndOInS("STEVE"    ,OT_USER        ,"GROUPS_I'M_IN";
  67.  *                 ,"EVERYONE" ,OT_USER_GROUP)
  68.  *
  69.  *  $SEEALSO$
  70.  *     fn_adBndO() fn_dBndOSe()
  71.  *  $END$
  72.  */
  73.  
  74. #include "ftint86.ch"
  75. #include "netto.ch"
  76.  
  77. #xcommand DEFAULT <v1> TO <x1> [, <vN> TO <xN> ];
  78.       => IIF((<v1>)=NIL,<v1>:=<x1>,NIL) [; IF((<vN>)=NIL,<vN>:=<xN>,NIL)]
  79.  
  80. #define NW_LOG 227
  81.  
  82. #ifdef FT_TEST
  83.  
  84.   FUNCTION MAIN(cOwner, nOwnerType, cProperty, cMemberName, nMemberType)
  85.   LOCAL lInSet
  86.     DEFAULT cOwner     TO "EVERYONE"
  87.     DEFAULT nOwnerType     TO  "2"   //  OT_USER_GROUP
  88.     DEFAULT cProperty     TO  "GROUP_MEMBERS"
  89.     DEFAULT cMemberName  TO  "SUPERVISOR"
  90.     DEFAULT nMemberType  TO  "1"   //  OT_USER
  91.     Qout("Owner       Type     Property     Member    Type")
  92.     Qout(cOwner, nOwnerType, cProperty, cMemberName, nMemberType)
  93.     IF FN_bndOInS(cOwner, Val(nOwnerType), cProperty, cMemberName, Val(nMemberType))
  94.       QQout("Found")
  95.     ELSE
  96.       QQout("Error:", fn_error())
  97.     ENDIF
  98.   RETURN ( nil )
  99.  
  100. #endif
  101.  
  102.  
  103. FUNCTION FN_bndOInS(cOwner, nOwnerType, cProperty, cMemberObject, nMemberType)
  104.  
  105.   LOCAL cSend := I2BYTE(67);            // 43h  API request code
  106.            + W2HILO(nOwnerType);        // nw_int Object type
  107.            + fn_NameL(cOwner,48);        // Property Owner Object Name
  108.            + fn_NameL(cProperty,16);    // Property Name
  109.            + W2HILO(nMemberType);        // nw_int Member Object type
  110.            + fn_NameL(cMemberObject,48) // Object to search for
  111.  
  112. RETURN _fnReq(NW_LOG,cSend,"") == ESUCCESS
  113.  
  114.