Count: Integer;
The Count property returns number of dependencies in a collection.
Executing the example requires that the repository contains a custom class object with the OBJ_CUSTOM identifier.
Sub UserProc;
Var
Mb: IMetabase;
CustomObject: IMetabaseCustomObject;
Reader: IMetabaseCustomObjectReader;
References: IMetabaseCustomObjectReferences;
Ref: IMetabaseCustomObjectReference;
i: Integer;
Begin
Mb := MetabaseClass.Active;
CustomObject := Mb.ItemById("OBJ_CUSTOM").Bind As IMetabaseCustomObject;
Reader := CustomObject.CreateReader;
References := Reader.References;
For i := 0 To References.Count - 1 Do
Ref := References.Item(i);
Debug.WriteLine("Object name: " + Ref.Object.Name);
Debug.WriteLine("Dependency key: " + Ref.Key.ToString);
Debug.WriteLine("---");
End For;
End Sub UserProc;
After executing the example, the condole window displays information about the objects, on which the specified object depends.
See also: