RemoveByKey(Key: Integer): Boolean;
Key. Removed segment key.
The RemoveByKey method removes a segment from the collection by its key.
The method returns True if removal was successful.
Executing the example requires that the repository contains a time series database with the OBJ_RUBRICATOR identifier.
Sub UserProc;
Var
Mb: IMetabase;
RubInst: IRubricatorInstance;
Segs: IRubricatorSegments;
Begin
Mb := MetabaseClass.Active;
RubInst := Mb.ItemById("OBJ_RUBRICATOR").Open(Null) As IRubricatorInstance;
Segs := RubInst.Segments;
If Segs.FindByKey(1) <> Null Then
Segs.RemoveByKey(1);
Else
Debug.WriteLine("Segment with the 1 key is not found.");
End If;
End Sub UserProc;
After executing the example the segment with the specified key is searched. If the segment is found, it is removed.
See also: