IRubricatorSegmentsSet.RemoveByKey

Syntax

RemoveByKey(Key: Integer): Boolean;

Parameters

Key. Removed segment key.

Description

The RemoveByKey method removes segment from the collection by key. 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 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 Segs.RemoveByKey(1);

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. If the segment is found, it is removed.

See also:

IRubricatorSegmentsSet