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

  1. /*
  2.  * File......: RENAMOBJ.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_renBndO()
  23.  *  $CATEGORY$
  24.  *     Bindery
  25.  *  $ONELINER$
  26.  *     Rename Bindery Object
  27.  *  $SYNTAX$
  28.  *
  29.  *     FN_renBndO(cObjectName, cNewName, nObjectType) => lChanged
  30.  *
  31.  *  $ARGUMENTS$
  32.  *
  33.  *     <cObjectName> is the name of the Bindery Object that you are
  34.  *             trying to change the name for. Max length 47.
  35.  *
  36.  *     <cNewName> is the new name of the Bindery Object.  Maximum of
  37.  *          47 characters is allowed.
  38.  *
  39.  *     <nObjectType> is the Bindery Object Type.  Manifest constants
  40.  *             describing the defined types are included in the
  41.  *             NETTO.CH header file.
  42.  *
  43.  *  $RETURNS$
  44.  *
  45.  *     <lChanged> if name was changed or not.
  46.  *
  47.  *  $DESCRIPTION$
  48.  *
  49.  *     This function renames a bindery object.    It requires supervisor
  50.  *     rights.
  51.  *
  52.  *  $EXAMPLES$
  53.  *
  54.  *     lChanged :=  FN_renBndO("IDENTIFICATION", "FULLNAME", OT_USER_GROUP)
  55.  *
  56.  *  $SEEALSO$
  57.  *
  58.  *     FN_BndONam()
  59.  *
  60.  *  $END$
  61.  */
  62.  
  63. #include "ftint86.ch"
  64. #include "netto.ch"
  65.  
  66.  
  67. #define NW_LOG 227
  68.  
  69. #ifdef FT_TEST
  70.   FUNCTION MAIN(cObject, cNewName, nType)
  71.     IF FN_renBndO(cObject, cNewName, Val(nType))
  72.       Qout("Object name has been changed.")
  73.     ELSE
  74.       Qout("Object name has not been changed.")
  75.       Qout("Error:")
  76.       QQout(FN_Error())
  77.       Qout()
  78.     ENDIF
  79.  
  80.   RETURN ( nil )
  81.  
  82. #endif
  83.  
  84. FUNCTION FN_renBndO(cOldName, cNewName, nType)
  85.  
  86.   LOCAL cSend := I2BYTE(52);        // 34h API Function Request Code
  87.            + W2HILO(nType);     // nw_int Object type
  88.            + FN_NameL(cOldName,48); // Current Object Name Length encoded
  89.            + FN_NameL(cNewName,48)    // Desired Object Name Length encoded
  90.  
  91. RETURN _fnReq(NW_LOG,cSend,"") == ESUCCESS
  92.