# EssOtlGetUserAttributes

Description

EssOtlGetUserAttributes() retrieves all user-defined attributes for a member.

Syntax

    ESS_FUNC_M EssOtlGetUserAttributes (hOutline, hMember, pusCount,
    ppAttributeList);

ESS_HOUTLINE_T | hOutline
ESS_HMEMBER_T | hMember
ESS_PUSHORT_T | pusCount
ESS_PPMBRNAME_T | ppAttributeList

Parameters

hOutline | Outline context handle.
hMember | Handle of member for which to get the user-defined attribute.
pusCount | Count of user attributes returned; defines the number of elements in the ppAttributeList array.
ppAttributeList | Array of *pusCount members. Each element of the array contains a single user-defined attribute string.

Return Value

Returns 0 if successful.

Notes

- A caller can set any number of user-defined attributes for a member using the EssOtlSetUserAttribute() call. Each attribute is defined as a unique string that follows the same conventions as member names.
- A user attribute can be the same as any member name, alias, or generation or level name.
- Call EssFree() to free the returned attribute list.

Example

    #include <essapi.h>
    #include <essotl.h>

    ESS_STS_T          sts = 0;
    ESS_HOUTLINE_T     hOutline;
    ESS_OBJDEF_T       Object;
    ESS_APPNAME_T      szAppName;
    ESS_DBNAME_T       szDbName;
    ESS_OBJNAME_T      szFileName;
    ESS_HMEMBER_T      hMember;
    ESS_USHORT_T       Count, ind;
    ESS_PMBRNAME_T     AttributeList = ESS_NULL;

    memset(&Object, '\0', sizeof(Object));
    Object.hCtx = hCtx;
    Object.ObjType = ESS_OBJTYPE_OUTLINE;
    strcpy(szAppName, "Sample");
    strcpy(szDbName, "Basic");
    strcpy(szFileName, "Basic");
    Object.AppName  = szAppName;
    Object.DbName   = szDbName;
    Object.FileName = szFileName;

    sts = EssOtlOpenOutline(hCtx, &Object, ESS_TRUE,
          ESS_TRUE, &hOutline);

    /************  Get User Attributes ***********/

    if (!sts)
    {
       sts = EssOtlFindMember(hOutline, "Jan",
             &hMember);
    }

    if (!sts && hMember)
    {
       sts = EssOtlGetUserAttributes(hOutline,
             hMember, &Count, &AttributeList);
    }

    if (!sts && AttributeList)
    {
       printf("User Attribute:\n");
             for(ind = 0; ind < Count; ind++)
       {
       printf("%s\n",AttributeList[ind]);
       }
       EssFree(hInst, AttributeList);
    }

See Also

EssOtlDeleteUserAttribute()
EssOtlSetUserAttribute()