EnumIDsOfChildren

Returns either the top members of a dimension hierarchy or the child members of a parent member.

Syntax

<IHsvTreeInfo>.EnumIDsOfChildren(lListTopMemberID, lItemID, pvarChildIDArray)

Argument

Description

lListTopMemberID

Long (ByVal). Pass the HFMConstants type library constant TREE_ROOT to this argument.

lItemID

Long (ByVal). The value you pass depends upon whether you want to return the top members of a hierarchy or the children of a parent:

  • To return the top members of a hierarchy, pass -1.

  • To return the children of a member, pass the parent’s member ID.

pvarChildIDArray

Variant array. Returns the member IDs of either the dimension hierarchy’s top members or of a parent’s child members, depending upon the value passed to the lItemID.

Return Value

Integer. Indicates the success of the function call; returns 0 for success or -1 for an error.

Example

This example prints the member labels of the Entity dimension’s top members to the Immediate window. Note how -1 is passed to both the lListTopMemberID and lItemID arguments.

Dim cMetadata As HsvMetadata, cTreeInfo As IHsvTreeInfo
Dim vaChildIDs, sLabel As String, iSuccess As Integer
Set cMetadata = m_cSession.Metadata
Set cTreeInfo = cMetadata.Entities
iSuccess = cTreeInfo.EnumIDsOfChildren(TREE_ROOT, -1, _ 
vaChildIDs)
If iSuccess = 0 Then
  For i = LBound(vaChildIDs) To UBound(vaChildIDs)
    cTreeInfo.GetLabel CLng(vaChildIDs(i)), sLabel
    Debug.Print sLabel
  Next i
End If

Tip:

If you replaced the line above that calls EnumIDsOfChildren with the following lines, then the example would print the children of the California entity:

  lPar = cTreeInfo.GetItemID("California")
  iSuccess = cTreeInfo.EnumIDsOfChildren(TREE_ROOT, lPar, _ 
  vaChildIDs)