FindByKey(Key: Integer): IRubricatorSegment;
Key. Segment key.
The FindByKey method searches for a segment in the collection by its key.
Executing the example requires that the repository contains a time series database with the OBJ_RUBRICATOR identifier, in which segments must be determined.
Sub Main;
Var
mb: IMetabase;
rubInst: IRubricatorInstance;
Rub: IRubricator;
Segs: IRubricatorSegments;
Begin
mb := MetabaseClass.Active;
Rub := mb.ItemById("OBJ_RUBRICATOR").Bind As IRubricator;
rubInst := (Rub As IMetabaseObjectDescriptor).Open(Null) As IRubricatorInstance;
Segs := rubInst.Segments;
If Segs.FindByKey(1) <> Null
Then Debug.WriteLine("Segment with key 1 found.");
Else Debug.WriteLine("Segment with key 1 is not found.");
End If;
End Sub Main;
After executing the example the segment with the specified key is searched. Search results are displayed in the console window.
See also: