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

  1. /*
  2.  * File......: DELOBJS.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_dBndOSe()
  23.  *  $CATEGORY$
  24.  *     Bindery
  25.  *  $ONELINER$
  26.  *     Delete Bindery Object From Set
  27.  *  $SYNTAX$
  28.  *
  29.  *     FN_dBndOse(cOwnerName, nOwnerType, cProperty, cMemberName, nMemberType  )
  30.  *           => lDeleted
  31.  *
  32.  *  $ARGUMENTS$
  33.  *
  34.  *     <cOwnerName> is the name of the Bindery Object that owns the SET
  35.  *            property from which you will delete 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 delete from 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.  *  $RETURNS$
  53.  *
  54.  *     <lDeleted> if object was deleted from set.
  55.  *
  56.  *  $DESCRIPTION$
  57.  *
  58.  *     This function deletes an object from a Bindery objects property set.
  59.  *
  60.  *  $EXAMPLES$
  61.  *
  62.  *     // This example deletes Group DEVELOPMENT from
  63.  *     // STEVE's  GROUPS_I'M_IN set
  64.  *
  65.  *     lDeleted := FN_dBndOSe("STEVE"    ,OT_USER        ,"GROUPS_I'M_IN";
  66.  *                   ,"DEVELOPMENT" ,OT_USER_GROUP)
  67.  *
  68.  *  $SEEALSO$
  69.  *     fn_adBndO() fn_delBndO()
  70.  *  $END$
  71.  */
  72.  
  73. #include "ftint86.ch"
  74. #include "netto.ch"
  75.  
  76. #xcommand DEFAULT <v1> TO <x1> [, <vN> TO <xN> ];
  77.       => IIF((<v1>)=NIL,<v1>:=<x1>,NIL) [; IF((<vN>)=NIL,<vN>:=<xN>,NIL)]
  78. #define NW_LOG 227
  79.  
  80. #ifdef FT_TEST
  81.  
  82.   FUNCTION MAIN(cOwnerName, nOwnerType, cProperty, cMemberObject, nMemberType)
  83.     DEFAULT cOwnerName TO "TESTUSER"
  84.     DEFAULT nOwnerType TO "1" // OT_USER
  85.     DEFAULT cProperty  TO "GROUPS_I'M_IN"
  86.     DEFAULT cMemberObject TO "TESTGROUP"
  87.     DEFAULT nMemberType   TO "2" // OT_USER_GROUP
  88.     IF FN_dBndOSe(cOwnerName, Val(nOwnerType), cProperty, cMemberObject, Val(nMemberType))
  89.       Qout("Object has been deleted.")
  90.     ELSE
  91.       Qout("Object has not been deleted.")
  92.     ENDIF
  93.   RETURN ( nil )
  94.  
  95. #endif
  96.  
  97. FUNCTION FN_dBndOSe(cOwnerName, nOwnerType, cProperty, cMemberObject, nMemberType)
  98.  
  99.   LOCAL cSend := I2BYTE(66);            // 42h API request code
  100.         +W2HILO(nOwnerType);        // nw_int Prop Owner Object type
  101.         +FN_NameL(cOwnerName,48);   // Property Owner Object Name
  102.         +FN_NameL(Upper(cProperty),16);    // Property Name
  103.         +W2HILO(nMemberType);        // nw_int Member Object type
  104.         +FN_NameL(cMemberObject,48) // Member Object's Name
  105.  
  106.      // See  crtprop.prg for Upper(cProperty) discussion
  107.  
  108. RETURN _fnReq(NW_LOG,cSend,"") == ESUCCESS
  109.