IRdsElementsIterator.CreateChildrenIterator

Syntax

CreateChildrenIterator(Parent: IRdsDictionaryElement;
                       FirstElement: Integer;
                       [CopyFilter: Boolean = True]): IRdsElementsIterator;

Parameters

Parent. Element, for which an iterator is created.

FirstElement. Index of the first element.

CopyFilter. Indicates if the parent iterator filter is copied.

Description

The CreateChildrenIterator method creates an iterator used to navigate children for a specified dictionary element.

Comments

The CopyFilter parameter is optional in the Fore language, and its default value is True, that is, child iterator uses the same element filter as the parent iterator.

Example

Executing the example requires that the repository contains an MDM dictionary with the RDS_DICT identifier.

Add links to the Metabase, Rds system assemblies.

Sub UserProc;
Var
    Mb: IMetabase;
    RdsInst: IRdsDictionaryInstance;
    elSearch: IRdsDictionaryElementsSearch;
    Dict: IRdsDictionary;
    Iter: IRdsElementsIterator;
    IterCh: IRdsElementsIterator;
Begin
    Mb := MetabaseClass.Active;
    // Get dictionary, where the search will be run
    RdsInst := Mb.ItemById("RDS_DICT").Open(NullAs IRdsDictionaryInstance;
    Dict := RdsInst.Dictionary;
    // Create an object for dictionary  search
    elSearch := RdsInst.CreateSearch;
    // Check whether search is performed among the elements obtained from the iterator
 
    If Not elSearch.IsIterator Then
        // Create an iterator
        Iter := RdsInst.BigElements.CreateIterator(1100NullNull);
        // Set the created iterator for the object that performs search
        elSearch.SetIterator(Iter);
        // Display iterator elements in the console window
        Debug.WriteLine("Iterator elements:");
        Iter.First; Iter.Next;
        Debug.WriteLine(Iter.Element.Name);
        IterCh := Iter.CreateChildrenIterator(Iter.Element, 0True);
        IterCh.First;
        While IterCh.Next Do
            Debug.WriteLine("  " + IterCh.Element.Name);
        End While;
    End If;
End Sub UserProc;

After executing the example the development environment console display the first dictionary element and its child elements.

See also:

IRdsElementsIterator