MoveAsChild method: Leaf class

Syntax

MoveAsChild(Node)

Description

The MoveAsChild method moves the leaf executing the method to a different node in the tree. The leaf becomes the first child leaf under the node, even though there is no explicit ordering of leaves: leaves take the order of the alphanumeric database sort on their range fields. The specified node becomes the new parent to the leaf.

Parameters

Parameter Description

Node

Specify a node object. This parameter value must be an object, not a string or a name.

Note:

To specify a node name, not a node object, use the MoveAsChildByName method.

Returns

A number; 0 if the move is successful.

Example

The following example moves leaf 8001 from node 10100 (old parent) to node 00001 (new parent)

&MY_LEAF = &MY_TREE.FindLeaf("8001", "8001"); 
&NEW_PARENT = &MY_TREE.FindNode("00001", ""); 
If &NEW_PARENT <> Null Then 
   &RET_VALUE = &MY_LEAF.MoveAsChild(&NEW_PARENT); 
End-If;