EnumDescendants

Returns an array containing the member IDs of a given member’s descendants.

Syntax

<IHsvTreeInfo>.EnumDescendants lItemID, bIgnoreDups, pvaralIDs

Argument

Description

lItemID

Long (ByVal). The member ID of the member.

bIgnoreDups

Boolean (ByVal). Specifies whether duplicate member IDs are returned. Pass TRUE to filter out duplicates, FALSE to return duplicates.

pvaralIDs

Variant array. Returns the array of the descendants’ member IDs. The array is returned as a Long subtype.

Example

The following example prints the labels of the UnitedStates entity’s descendant members to the Immediate window. The example loops through the array returned by EnumDescendants, passing the member IDs to GetLabel.

Dim cMetadata As HsvMetadata, lMember As Long
Dim cTreeInfo As IHsvTreeInfo, vaIDs
Dim sLabel As String
Set cMetadata = m_cSession.Metadata
Set cTreeInfo = cMetadata.Entities
lMember = cTreeInfo.GetItemID("UnitedStates")
cTreeInfo.EnumDescendants lMember, FALSE, vaIDs
'Exit the sub if there are no descendants
If IsEmpty(vaIDs) = True Then Exit Sub
For i = LBound(vaIDs) To UBound(vaIDs)
  cTreeInfo.GetLabel vaIDs(i), sLabel
  Debug.Print sLabel
Next i