RemoveByKey(AttributeKey: Integer): Boolean;
AttributeKey.Attribute key.
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.
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(4891) Then
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: