2.2.3.17.30 TreeNode::RemoveAttribute

Description

Removes the attribute of a node.

Syntax

BOOL RemoveAttribute( LPCSTR lpcszAttrName )

Parameters

lpcszAttrName
[input]name of attribute

Return

TRUE if attribute existed and was deleted successfully, FALSE if attribute does not exist.

Examples

EX1

void TreeNode_RemoveAttribute_ex1()
{
	// add a node and add Label attribute with string type value 	
    Tree myTree;    
    TreeNode tn1 = myTree.AddTextNode("abc", "node1", 2);
    tn1.SetAttribute("Label", "xyz");    
    
    // remove Label attribute
    bool flag = tn1.RemoveAttribute("Label");
    out_int("", flag); // 1
    
    // to get Label attribute, but since it has been removed, so should return false.
    string strVal;
    flag = tn1.GetAttribute("Label", strVal);
    out_int("", flag); // 0
}

Remark

See Also

TreeNode::SetAttribute, TreeNode::GetAttribute

Header to Include

origin.h