# EssOtlMoveMember

Description

EssOtlMoveMember() moves a member.

Syntax

    ESS_FUNC_M EssOtlMoveMember (hOutline, hMember,  hNewParent, hNewPrevSibling);

ESS_HOUTLINE_T | hOutline
ESS_HMEMBER_T | hMember
ESS_HMEMBER_T | hNewParent
ESS_HMEMBER_T | hNewPrevSibling

Parameters

hOutline | Outline context handle
hMember | Handle of member to move
hNewParent | Handle of new parent. Use this field only if the hNewPrevSibling field is ESS_NULL.
hNewPrevSibling | Handle of new previous sibling

Return Value

Returns 0 if successful; otherwise:
OTLAPI_BAD_MOVE

Notes

- The moved member is inserted following the hPrevSibling member. If this field is ESS_NULL, the moved member becomes the first child of the parent specified by hParent.
- If both hParent and hPrevSibling are ESS_NULL, the moved member becomes the first dimension in the outline.
- Moving a zero-level (leaf node) attribute member that is not of type ESS_ATTRMBRDT_STRING resets the member's long name, using the specifications for the outline in the ESS_ATTRSPECS_T structure.
- Moving an ancestor may affect the long name of a zero-level attribute member.

Example

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

    ESS_STS_T          sts = 0;
    ESS_HOUTLINE_T     hOutline;
    ESS_HMEMBER_T      hMemberJan;
    ESS_HMEMBER_T      hMemberMar;
    ESS_OBJDEF_T       Object;
    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, "Jan",
             &hMemberJan);
    }

    if (!sts && hMemberJan)
    {
       sts = EssOtlFindMember(hOutline, "Mar",
             &hMemberMar);
    }

    if (!sts && hMemberMar)
    {
       sts = EssOtlMoveMember(hOutline, hMemberJan,
             ESS_NULL, hMemberMar);
    }

See Also

EssOtlFindMember()
EssOtlRenameMember()
EssOtlAddMember()
EssOtlDeleteMember()