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

  1. /*
  2.  * File......: ADDBIND.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_adBndO()
  23.  *  $CATEGORY$
  24.  *     Bindery
  25.  *  $ONELINER$
  26.  *     Add Bindery Object To Set
  27.  *  $SYNTAX$
  28.  *
  29.  *     FN_adBndO(cOwnerName, nOwnerType, cProperty, cMemberName, nMemberType  )
  30.  *           => lAdded
  31.  *
  32.  *  $ARGUMENTS$
  33.  *
  34.  *     <cOwnerName> is the name of the Bindery Object that owns the SET
  35.  *            property to which you will add a member.
  36.  *            Max Length = 47
  37.  *
  38.  *     <nOwnerType> is the Object Type for <cOwnerName>.  Manifest constants
  39.  *            describing the defined types are included in the NETTO.CH
  40.  *            header file.
  41.  *
  42.  *     <cProperty> is the string containing the name of the <cOwnerName>'s
  43.  *           SET property.  Max Length = 15
  44.  *
  45.  *     <cMemberObject> Bindery Object Name that you will add to cProperty.
  46.  *               Max Length = 47
  47.  *
  48.  *     <nMemberType> is the Object Type for <cMemberName>.  Manifest
  49.  *             constants describing the defined types are included 
  50.  *             in the NETTO.CH header file.
  51.  *
  52.  *
  53.  *  $RETURNS$
  54.  *
  55.  *     <lAdded> Logical if Object was successfully added.
  56.  *
  57.  *  $DESCRIPTION$
  58.  *
  59.  *     This function adds a bindery object to a property of type set.
  60.  *     It returns true if successful or false if an error occured.
  61.  *
  62.  *  $SEEALSO$
  63.  *    fn_wrProVa() fn_dBndOSe()
  64.  *  $EXAMPLES$
  65.  *
  66.  *     // this will make user KEVIN a member of the development group.
  67.  *     lAdded := FN_adBndO("KEVIN", OT_USER, "GROUPS_I'M_IN";
  68.  *            , "DEVELOPMENT", OT_USER_GROUP)
  69.  *
  70.  *  $END$
  71.  */
  72.  
  73. #include "ftint86.ch"
  74. #include "netto.ch"
  75.  
  76. #define NW_LOG 227
  77.  
  78. #ifdef FT_TEST
  79.   FUNCTION MAIN(cOwnerName, nOwnerType, cProperty, cMemberObject, nMemberType  )
  80.   LOCAL lAdded
  81.     DEFAULT cOwnerName TO "TESTUSER"
  82.     DEFAULT nOwnerType TO "1" // OT_USER
  83.     DEFAULT cProperty  TO "GROUPS_I'M_IN"
  84.     DEFAULT cMemberObject TO "TESTGROUP"
  85.     DEFAULT nMemberType   TO "2" // OT_USER_GROUP
  86.  
  87.     lAdded := FN_adBndO(cOwnerName,Val(nOwnerType), cProperty, cMemberObject, Val(nMemberType))
  88.     Qout(lAdded)
  89.   RETURN ( nil )
  90.  
  91.  
  92. #endif
  93.  
  94. FUNCTION FN_adBndO(cObject, nType, cProperty, cMemberObject, nMemberType)
  95.  
  96.   LOCAL cSend := I2BYTE(65);                   // 41h API Request Code
  97.            + W2HILO(nType);                   // nw_int Object type
  98.            + fn_NameL(cObject,48);            // Owner Name
  99.            + fn_NameL(Upper(cProperty),16);  // Property Name
  100.            + W2HILO(nMemberType);               // nw_int Member Object type
  101.            + fn_NameL(cMemberObject,48)      // Member name to be added
  102.  
  103.   // See  crtprop.prg for Upper(cProperty) discussion
  104.  
  105. RETURN _fnReq(NW_LOG,cSend,"") == ESUCCESS
  106.