IRdsDictionaryElements.Child

Syntax

Child(Element: Integer; ChildIndex: Integer): Integer;

Parameters

Element - element key.

ChildIndex - child element index.

Description

The Child property returns a key of a child element for the Element element, which index is passed by the ChildIndex parameter.

Example

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

Sub Main;

Var

MB: IMetabase;

Dict: IRdsDictionary;

DictInst: IRdsDictionaryInstance;

Elements: IRdsDictionaryElements;

Attrs: IRdsAttributes;

i, j: Integer;

Begin

MB := MetabaseClass.Active;

Dict := MB.ItemByIdNamespace("Dict_1", MB.ItemById("NSI_1").Key).Bind As IRdsDictionary;

Attrs := Dict.Attributes;

j := Attrs.Name.Key; // attribute key

DictInst := Dict.Open(Null);

Elements := DictInst.Elements;

For i := 0 To Elements.ChildrenCount(-2) - 1 Do

Debug.WriteLine(Elements.Attribute(Elements.Child(-2, i), j));

End For;

End Sub Main;

After executing the example values of the Name attribute are displayed in the console for all dictionary root elements.

See also:

IRdsDictionaryElements