EnumMembers

Returns an array containing the member IDs of the dimension members in either the default dimension hierarchy or in a member list. The value passed to the lListID argument determines whether the returned IDs are from the default hierarchy or from a list.

Tip:

To return members of a dynamic member list, use EnumMembers2.

For the Entity dimension, EnumMembers returns child entity member IDs in the pvaralItemIDs argument and the corresponding parent member IDs in the pvaralParentIDs argument. For the other dimensions, EnumMembers returns members in the pvaralItemIDs argument, and the pvaralParentIDs argument is left uninitialized.

Tip:

If you return members from the default dimension hierarchy, you can also use the lListTopMemberID argument to return only members of a given node.

Syntax

<IHsvTreeInfo>.EnumMembers lListID, lListTopMemberID, pvaralItemIDs, pvaralParentIDs

Argument

Description

lListID

Long (ByVal). Identifies either the default dimension hierarchy or a member list. Pass the HFMConstants type library constant MEMBER_LIST_ALL_HIERARCHY to return the members in the default hierarchy, or a valid list ID to return the members in a member list.

Tip:

You can get member list IDs with GetMemberListID. For more information, see GetMemberListID.

lListTopMemberID

Long (ByVal). The usage of this argument depends on what you pass to the lListID argument:

  • If you pass MEMBER_LIST_ALL_HIERARCHY to lListID, you can return either member IDs for all of the dimension’s members by passing the TREE_ROOT constant, or member IDs for a node’s members by passing the member ID of the node’s parent.

  • If you pass anything other than MEMBER_LIST_ALL_HIERARCHY to lListID, the lListTopMemberID argument is ignored. Because this argument is not optional, you must still pass a valid Long.

pvaralItemIDs

Variant array. For the Entity dimension, this argument returns the member IDs of the child entities. For the other dimensions, this argument returns the member IDs of the dimension members.

The array is returned as a Long subtype.

pvaralParentIDs

Variant array. For the Entity dimension, this argument returns the member IDs of the parents of the members returned in the pvaralItemIDs argument. The array is returned as a Long subtype.

For the other dimensions, an empty Variant is returned.

Example

The following example prints out a node of the Entity dimension to the Immediate window. The node’s parent member is Europe; note how MEMBER_LIST_ALL_HIERARCHY is passed as the lListID argument and how Europe’s member ID is passed as the lListTopMemberID argument.

Dim cTreeInfo As IHsvTreeInfo
Dim vaChildIDs, vaParIDs, lEnt As Long
Dim sLabel As String, sParLabel As String
Set cTreeInfo = m_cMetadata.Entities
lEnt = cTreeInfo.GetItemID("Europe")
cTreeInfo.EnumMembers MEMBER_LIST_ALL_HIERARCHY, lEnt, _ 
vaChildIDs, vaParIDs
For i = LBound(vaChildIDs) To UBound(vaChildIDs)
  cTreeInfo.GetLabel CLng(vaParIDs(i)), sParLabel
  cTreeInfo.GetLabel CLng(vaChildIDs(i)), sLabel
  Debug.Print sParLabel & " " & sLabel
Next i