Returns the member IDs of those members of a member list with descriptions that match a search string in a given language. Each time a member matching the search criteria is found, the member ID of the member and the member ID of its parent are returned.
The pbFoundMatch argument returns a Boolean that indicates the success of the find operation, thus allowing you to loop until all occurrences are found, as shown in the example.
<IHsvTreeInfo>.FindByDesc lListID, lTopMemberID, bstrSearchText, bForward, lLanguageID, plPos, plMemberID, plParentID, pbFoundMatch
Long (ByVal). Identifies either the default dimension hierarchy or a member list. Pass the HFMConstants type library constant MEMBER_LIST_ALL_HIERARCHY to search the default hierarchy, or a valid list ID to search a member list. You can get member list IDs with GetMemberListID. | |
Long (ByVal). The usage of this argument depends on what you pass to the lListID argument:
| |
String (ByVal). The search string. Pass all or part of the descriptions for which the search is being conducted. If you pass a partial description, the method searches for all descriptions that begin with the passed string. | |
Boolean (ByVal). Indicates whether the search will go forwards or backwards in the dimension hierarchy or member list. Pass TRUE to search forwards, FALSE to search backwards. | |
Long (ByVal). The ID of the language. You can get this ID with the EnumLanguages method of the HsvMetadata object. | |
Long. Sets the starting position of the search within the dimension hierarchy or member list, and returns a number that should be passed to the next call to Find. Use this argument as follows: | |
Long. If a description is found that matches the search string, this argument returns the member ID of the member. | |
Long. If a description is found that matches the search string, this argument returns the member ID of the member’s parent. | |
Boolean. Returns TRUE if a member label is found that matches the search string, otherwise FALSE. |
The following subroutine prints to Visual Basic’s Immediate window the labels of all members of a given dimension and member list that have descriptions partially matching the specified string. The example also prints labels of parent members.
Sub printListDescMatch(iDim As Integer, lListId As Long, _ sDesc As String, lLangId As Long) Dim lPos As Long, cTreeInfo As IHsvTreeInfo, lMem As Long Dim lPar As Long, bRet As Boolean, sMemLabel As String Dim sParLabel As String 'g_cMetadata is an HsvMetadata object reference Set cTreeInfo = g_cMetadata.Dimension(iDim) lPos = -1 bRet = True Do cTreeInfo.FindByDesc lListId, TREE_ROOT, sDesc, True, lLangId, _ lPos, lMem, lPar, bRet If bRet = True Then cTreeInfo.GetLabel lMem, sMemLabel cTreeInfo.GetLabel lPar, sParLabel Debug.Print sMemLabel & " " & sParLabel End If Loop Until bRet = False End Sub