IRdsDictionaryElementArray.Item

Syntax

Item(Index: Integer): Integer;

Parameters

Index - array element index.

Description

The Item property returns a key of an element contained in an array element, which index is passed by the Index 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;

Arr: IRdsDictionaryElementArray;

Attrs: IRdsAttributes;

i, Key, 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;

Arr := Elements.Children(Elements.Item(1).Key);

For i := 0 To Arr.Count - 1 Do

Key := Arr.Item(i);

Debug.WriteLine(Elements.Attribute(Key, j));

End For;

End Sub Main;

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

See also:

IRdsDictionaryElementArray