IRdsAttributesInstance.Item

Syntax

Item(Index: Integer): IRdsAttributeInstance;

Parameters

Index - attribute index.

Description

The Item property returns an attribute of a dictionary, 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 UserProc;
Var
    MB: IMetabase;
    Dict: IRdsDictionary;
    DictInst: IRdsDictionaryInstance;
    AttrsInst: IRdsAttributesInstance;
    AttrInst: IRdsAttributeInstance;
    i: Integer;
Begin
    MB := MetabaseClass.Active;
    Dict := MB.ItemByIdNamespace("DICT_1", MB.ItemById("NSI_1").Key).Bind As IRdsDictionary;
    DictInst := Dict.Open(NullAs IRdsDictionaryInstance;
    AttrsInst := DictInst.Attributes;
    For i := 0 To AttrsInst.Count - 1 Do
        AttrInst := AttrsInst.Item(i);
        Debug.Write("Attribute: " + AttrInst.Name);
        If AttrInst.HasReadAccess Then
            Debug.Write("; Read access is present");
        Else
            Debug.Write("; Read access is absent");
        End If;
        If AttrInst.HasWriteAccess Then
            Debug.Write("; Write access is present;");
        Else
            Debug.Write("; Write access is absent;");
        End If;
        Debug.WriteLine("");
    End For;
End Sub UserProc;

After executing the example a list of attributes available in the MDM dictionary is displayed in development environment console. Existence of read and write permissions is specified by each attribute for a current user.

See also:

IRdsAttributesInstance