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

  1. /*
  2.  * File......: DELPROP.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_delProp()
  23.  *  $CATEGORY$
  24.  *     Bindery
  25.  *  $ONELINER$
  26.  *     Delete Property
  27.  *  $SYNTAX$
  28.  *
  29.  *     FN_delProp(cObjectName, nObjectType, cProperty) => lDeleted
  30.  *
  31.  *  $ARGUMENTS$
  32.  *
  33.  *     <cObjectName> is the name of the Bindery Object that you are
  34.  *             trying to delete a property for.  Max Length = 47
  35.  *
  36.  *     <nObjectType> is the Bindery Object Type.  Manifest constants
  37.  *             describing the defined types are included in the
  38.  *             NETTO.CH header file.
  39.  *
  40.  *     <cProperty> is the name of the property you want to delete.
  41.  *           Max Length = 15
  42.  *
  43.  *  $RETURNS$
  44.  *
  45.  *     <lDeleted> if property was deleted.
  46.  *
  47.  *  $DESCRIPTION$
  48.  *
  49.  *     This function deletes a bindery objects property.
  50.  *
  51.  *  $SEEALSO$
  52.  *    fn_creProp() fn_delBndO
  53.  *  $EXAMPLES$
  54.  *
  55.  *     // this will delete the property IDENDTIFICATION from user KEVIN
  56.  *     lDeleted := FN_delProp("KEVIN", OT_USER, "IDENTIFICATION")
  57.  *
  58.  *  $END$
  59.  */
  60.  
  61. #include "ftint86.ch"
  62. #include "netto.ch"
  63.  
  64. #xcommand DEFAULT <v1> TO <x1> [, <vN> TO <xN> ];
  65.       => IIF((<v1>)=NIL,<v1>:=<x1>,NIL) [; IF((<vN>)=NIL,<vN>:=<xN>,NIL)]
  66. #define NW_LOG 227
  67.  
  68. #ifdef FT_TEST
  69.   FUNCTION MAIN(cObject, nType, cProperty)
  70.     DEFAULT cObject    TO "TESTUSER"
  71.     DEFAULT nType      TO "1" // OT_USER
  72.     DEFAULT cProperty  TO "GROUPS_I'M_IN"
  73.     IF FN_delProp(cObject, Val(nType), cProperty)
  74.       Qout("Property has been deleted.")
  75.     ELSE
  76.       Qout("Property has not been deleted.")
  77.     ENDIF
  78.  
  79.   RETURN ( nil )
  80.  
  81. #endif
  82.  
  83. FUNCTION FN_delProp(cObject, nType, cProperty)
  84.  
  85.   LOCAL cSend := I2BYTE(58);          // 3Ah API Request Code
  86.            + W2HILO(nType);       // nw_int Object type
  87.            + fn_NameL(cObject,48);      // Owner Name
  88.            + fn_NameL(Upper(cProperty),16)     // Property Name
  89.  
  90.     // See  crtprop.prg for Upper(cProperty) discussion
  91.                
  92. RETURN _fnReq(NW_LOG,cSend,"") == ESUCCESS
  93.