# EssOtlFindMember

Description

EssOtlFindMember() finds a member with the specified name and returns a handle to the member.

Syntax

    ESS_FUNC_M EssOtlFindMember (hOutline, pszMember, phMember);

ESS_HOUTLINE_T | hOutline
ESS_STR_T | pszMember
ESS_PHMEMBER_T | phMember

Parameters

hOutline | Outline context handle.
pszMember | Member name to find.
phMember | Variable for the return of the member handle. ESS_NULL if the member is not found.

Return Value

Returns 0 if successful.

Notes

- If the target member has shared members, only the handle to the actual member is returned.
- Once you have the member handle to the actual member, use EssOtlGetNextSharedMember() to get shared member information.
- If no member is found, *phMember is set to ESS_NULL and the call returns 0.
- Whenever you use EssOtlFindMember(), always perform two checks: 1. Check the return status.
  2. Check whether the handle was returned.

Example

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

    ESS_STS_T          sts = 0;
    ESS_OBJDEF_T       Object;
    ESS_HOUTLINE_T     hOutline;
    ESS_HMEMBER_T      hDimProduct;
    ESS_APPNAME_T      szAppName;
    ESS_DBNAME_T       szDbName;
    ESS_OBJNAME_T      szFileName;

    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);

    if (!sts)
    {
         sts = EssOtlFindMember(hOutline, "Product",
             &hDimProduct);
    }

See Also

EssOtlMoveMember()
EssOtlRenameMember()
EssOtlAddMember()
EssOtlDeleteMember()
EssOtlGetNextSharedMember()