MoveAsChild method: Node class
Syntax
MoveAsChild(Node)
Description
The MoveAsChild method moves the node executing the method to a different node in the tree. The node becomes the first child node under the named node. The specified node becomes the new parent to the child node. The node specified by Node must be an existing node in the current tree. All child nodes and details are also moved with the node.
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 method is successful.
Example
The following example moves node 10200 from node 10100 (old parent) to node 00001 (new parent).
&MY_NODE = &MY_TREE.FindNode("10200", "");
&NEW_PARENT = &MY_TREE.FindNode("00001", "");
If &NEW_PARENT <> Null Then
&MY_NODE.MoveAsChild(&NEW_PARENT);
End-If;
Related Topics