EnumIDsOfIChildren

Returns children and the parent item of the requested children.

Syntax

<HsvTreeInfo>.EnumIDsOfIChildren(lListTopMemberID,
lItemID, pvarChildIDArray)
ArgumentDescription
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 and the member itself, 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 and the parent itself, 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 children and the entity itself to the Immediate window.

Dim cMetadata As HsvMetadata, cTreeInfo As IHsvTreeInfo
Dim vaChildIDs, sLabel As String, iSuccess As Integer
Set cMetadata = m_cSession.Metadata
Set cTreeInfo = cMetadata.Entities
  lPar = cTreeInfo.GetItemID("California")
  iSuccess = cTreeInfo.EnumIDsOfIChildren(TREE_ROOT, lPar, _ 
  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

The entity dimension's ID is the last item in the array.