IStandardDimIndexAttributes.RemoveByKey

Syntax

RemoveByKey(AttributeKey: Integer): Boolean;

Parameters

AttributeKey.Attribute key.

Description

The RemoveByKey method removes dictionary attribute from the index by the key passed by the AttributeKey parameter and returns True if it is successfully removed.

Example

Sub UserProc;
Var
    MB: IMetabase;
    MObj: IMetabaseObject;
    Dim: IStandardDimension;
    DimInds: IStandardDimIndexes;
    DimIndex: IStandardDimIndex;
    DimIndAttrs: IStandardDimIndexAttributes;
    s: String;
Begin
    MB:=MetabaseClass.Active;
    MObj:=MB.ItemById("TAB_DIM").Edit;
    Dim:=MObj As IStandardDimension;
    DimInds:=Dim.Indexes;
    If DimInds.Count<>0 Then
        DimIndex:=DimInds.Item(0);
        DimIndAttrs:=DimIndex.Attributes;
        If DimIndAttrs.RemoveByKey(4891Then
            s:="Remove";
        Else
            s:="Not remove";
        End If;
    End If;
    MObj.Save;
End Sub UserProc;

After executing the example the "s" variable contains Remove if the attribute with key 4891 is successfully removed from the first dictionary index. Table dictionary identifier: TAB_DIM.

See also:

IStandardDimIndexAttributes