RemoveByKey(AttributeKey: String): Boolean;
AttributeKey. Attribute key.
The RemoveByKey method removes an attribute from the collection based on the specified key. The key is passed by the AttributeKey parameter. This method returns True if the removal was successful.
This example is a fragment of the code that must be executed to remove the attribute from the collection. Executing the example requires the AttrValList variable of the IMsMetaAttributeValueList type.
Sub UserProc;
Var
…
AttrValList: IMsMetaAttributeValueList;
Begin
…
MetaAttrVal := MetaAttrValList.FindByKey(MetaAttr.Key);
If AttrValList.RemoveByKey(1) <> Null Then
Debug.WriteLine("Removal performed successfully");
Else
Debug.WriteLine("The attribute was not removed");
End If;
…
End Sub UserProc;
After executing the example the attribute with the 1 key is removed from the collection. The removal result is displayed in the console window.
See also: