MoveAsChildByName method: Leaf class
Syntax
MoveAsChildByName(NodeName)
Description
The MoveAsChildByName method moves the leaf executing the method to a different node in the tree. The leaf becomes the first child leaf under the node, although 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. The node specified by NodeName must be a valid node name.
Parameters
| Parameter | Description |
|---|---|
|
NodeName |
Specify the name of a node. NodeName must be a valid node for the existing tree. This parameter takes a string value. |
Note:
To specify a node object, not a node name, use the MoveAsChild 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");
If &MY_LEAF <> Null Then
&RET_VALUE = &MY_LEAF.MoveAsChildByName("00001");
End-If;
Related Topics