4. System Classes : Tree Class : AddNode Method
 
Share this page                  
AddNode Method
The AddNode method adds a new node to the tree. The new node object is returned.
This method has the following syntax:
TreeNode = Tree.AddNode(name = nvarchar(256)
          [, keylabel = varchar(256), relative = TreeNode, relation = integer])
This method has the following parameters:
name
(Required) Specifies the label string
keylabel
Specifies a unique string associated with the node that is used to retrieve a node with the NodeByKey method
relative
Specifies an existing TreeNode in the Tree
relation
Specifies the relationship of the node to the TreeNode specified in the relative parameter. Valid values are:
TN_LASTCHILD
Specifies that the new node is the last child of relative
TN_FIRSTCHILD
Specifies that the new node is the first child of relative
TN_NEXTSIBLING
Specifies that the new node is the next sibling of relative
Default: TN_LASTCHILD
Descriptions of system constant values and their numeric equivalents are listed in Relative Parameter Values for TreeNodes (see Relative Parameter Values for TreeNodes).
If relative is NULL, the relation parameter is ignored, and the new node becomes the root. The old root, if exists, becomes the next sibling of the new root.