Language Reference Guide : System Classes : Tree Class : MoveNode Method
 
Share this page          
MoveNode Method
The MoveNode method moves a node or branch from one place in a tree to another place in the same tree or a different tree. It returns the topmost moved node if successful, or NULL on failure.
This method has the following syntax:
TreeNode = Tree.MoveNode(sourcenode = TreeNode, destnode = TreeNode,
          [relation = integer, childnumber = integer)
This method has the following parameters:
sourcenode
The node being moved. This does not have to be in the Tree of the method.
destnode
Specifies an existing treenode in the Tree.
relation
(Optional) Specifies the relationship of the node to the TreeNode specified in the destnode parameter. Valid values are:
TN_LASTCHILD
Specifies that the new node is the last child of destnode
TN_FIRSTCHILD
Specifies that the new node is the first child of destnode
TN_NEXTSIBLING
Specifies that the new node is the next sibling of destnode
TN_NUMBEREDCHILD
Specifies the nth child of destnode where n is provided by the childnumber parameter
Default: TN_LASTCHILD
childnumber
(Optional) Specifies the number of the child position of the moved node. If this is greater than the number of siblings, it is the same as TN_LASTCHILD.
Note:  This parameter only has meaning if relation is set to TN_NUMBEREDCHILD.