IRubricatorSegmentsSet.RemoveByKey

Syntax

RemoveByKey(Key: Integer): Boolean;

Parameters

Key. Removed segment key.

Description

The RemoveByKey method removes a segment from the collection by its key.

Comments

The method returns True if removal was successful.

Example

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(NullAs 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:

IRubricatorSegmentsSet