FindByKindBasis(Basis: Integer; kKind: MetaAttributeKind; Var Index: Integer): IMetaAttribute;
Basis - basis, by which search is executed.
kKind - target attribute type.
Index - variable, in which index of a found attribute is returned.
The FindByKindBasis method searches an attribute by type and basis.
Executing the example requires that the repository contains a time series database with the OBJ_FC identifier.
Add links to the Metabase, Rds, Cubes system assemblies.
Sub UserProc;
Var
MB: IMetabase;
Rubr: IRubricator;
Facts: IMetaDictionary;
Atts: IMetaAttributes;
Attr: IMetaAttribute;
SS: IMetaAttributesSubset;
Rds: IMetabaseObjectDescriptor;
i: Integer;
ind: Integer;
Begin
MB := MetabaseClass.Active;
Rubr := MB.ItemById("OBJ_FC").Bind As IRubricator;
Facts := Rubr.Facts;
Atts := Facts.Attributes;
SS := Atts.CreateSubset("KEY;FACTOR", SubsetOperation.Select_);
Rds := mb.ItemById("RDS_REPO");
Attr := Atts.FindByKindBasis(-1, MetaAttributeKind.Revision, ind);
If Attr <> Null Then
SS.Add(Attr);
End If;
For i := 0 To SS.Count - 1 Do
Debug.WriteLine(SS.Item(i).Name);
End For;
End Sub UserProc;
After executing the example a set that consists of the attributes KEY and FACTOR is created. An attribute that determines indicator revision is also included to the set, the "ind" variable stores its index. Names of all attributes included in the set are displayed in the console window.
See also: