IMetaAttribute.EqualObject

Syntax

EqualObject(ObjectKey: Integer): Boolean;

Parameters

ObjectKey. Object key.

Description

The EqualObject method returns whether an attribute belongs to an object, which key is set in the ObjectKey parameter. If this method returns True, an attribute belongs to an object, if False, it does not belong.

Example

Executing the example requires that the repository contains a time series database with the OBJ_FC identifier and an MDM repository with the RDS_REPO identifier. The MDM repository must contain a dictionary with the DICT_IND identifier.

Sub Main;
Var
    Mb: IMetabase;
    RubrObj: IMetabaseObject;
    CatInst: IRubricatorInstance;
    DictInst: IMetaDictionaryInstance;
    HierarchyInst: IMetaHierarchyInstance;
    HierarchyAttr: IMetaHierarchyAttributes;
    Attr: IMetaAttribute;
    Dict: IMetabaseObjectDescriptor;
    Key: Integer;
Begin
    Mb := MetabaseClass.Active;
    RubrObj := Mb.ItemById("OBJ_FC").Bind;
    CatInst := RubrObj.Open(NullAs IRubricatorInstance;
    DictInst := CatInst.GetDictionary(RubricatorDictionary.Facts);
    HierarchyInst := DictInst.DefaultHierarchy;
    HierarchyAttr := HierarchyInst.Attributes;
    Attr := HierarchyAttr.Item(0);
    Key := Mb.GetObjectKeyById("RDS_REPO");
    Dict := Mb.ItemByIdNamespace("DICT_IND", Key);
    If Attr.EqualObject(Dict.Key) Then
        Debug.WriteLine(Attribute ' + Attr.Name + ' belongs to dictionary ' + Dict.Name + ');
    Else
        Debug.WriteLine(Attribute ' + Attr.Name + ' does not belong to dictionary ' + Dict.Name + ');
    End If;
End Sub Main;

After executing the example, the console window displays a message informing whether the first attribute of time series database hierarchy belongs to the DICT_IND dictionary.

See also:

IMetaAttribute