IsDescendant

Returns a Boolean that indicates whether an entity is a descendant of another entity.

Syntax

<HsvEntities>.IsDescendant lParentID, lEntityID, pbIsDescendant

Argument

Description

lParentID

Long (ByVal). The member ID of the possible higher-level entity.

lEntityID

Long (ByVal). The member ID of the possible descendant entity.

pbIsDescendant

Boolean. Returns TRUE if the lEntityID argument’s entity is a descendant of the lParentID argument’s entity, FALSE if it is not a descendant.

Example

The following example creates a function that takes the labels of an entity and its possible descendant entity and returns a Boolean indicating whether there is an ancestor – descendant relationship.

Function IsEntityDescendant(sParent As String, sIsDescend _ 
As String) As Boolean
Dim cEntities As HsvEntities, cTreeInfo As IHsvTreeInfo
Dim lParID As Long, lDescID As Long, bIsDesc As Boolean
Set cEntities = m_cMetadata.Entities
Set cTreeInfo = m_cMetadata.Entities
lParID = cTreeInfo.GetItemID(sParent)
lDescID = cTreeInfo.GetItemID(sIsDescend)
cEntities.IsDescendant lParID, lDescID, bIsDesc
IsEntityDescendant = bIsDesc
End Function