RemoveByKey(AttributeKey: Integer): Boolean;
AttributeKey. Attribute key.
The RemoveByKey method removes attribute, key of which is passed by the AttributeKey parameter.
Sub Main;
Var
MB: IMetabase;
MObj: IMetabaseObject;
Dimens: IStandardDimension;
DimAtrrs: IStandardDimAttributes;
s: String;
Begin
MB:=MetabaseClass.Active;
MObj:=MB.ItemById("TAB_DIM").Edit;
Dimens:=MObj As IStandardDimension;
DimAtrrs:=Dimens.Attributes;
If DimAtrrs.RemoveByKey(4796) Then
s:="Removed";
Else
s:="Not removed";
End If;
MObj.Save;
End Sub Main;
After executing the example the "s" variable contains Removed, if the table dictionary attribute with 4796 key is successfully removed. Table dictionary identifier: TAB_DIM.
See also: