IsChild

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

Syntax

<HsvEntities>.IsChild lParentID, lEntityID, pbIsChild

Argument

Description

lParentID

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

lEntityID

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

pbIsChild

Boolean. Returns TRUE if the lEntityID entity is a child of the lParentID entity, FALSE otherwise.

Example

The following example uses IsChild to see if the entity specified in the comboParent combo box is a parent of the entity specified in the comboChild combo box. If there is no parent-child relationship, the user is warned and the procedure is exited.

Dim bIsChild As Boolean, cEntities As HsvEntities
Dim cTreeInfo As IHsvTreeInfo, lParID As Long, lChildId As Long
Set cEntities = m_cMetadata.Entities
Set cTreeInfo = m_cMetadata.Entities
lParID = cTreeInfo.GetItemID(comboParent.Text)
lChildId = cTreeInfo.GetItemID(comboChild.Text)
cEntities.IsChild lParID, lChildId, bIsChild
If bIsChild = False Then
  MsgBox "The entities don’t have a parent-child relationship!"
  Exit Sub
End If