Share via


TreeNode.newObjectName Method

Returns a string that contains the name of the new element.

Syntax

public str newObjectName([str oldName])

Run On

Called

Parameters

  • oldName
    Type: str
    The new name of the node; optional. If no argument is passed, the new node name is determined by the child node type.

Return Value

Type: str
The string that contains the name of the new element.

Remarks

If no argument is passed, the new node name is determined by the child node type. For example, if the TreeNode has forms as children, calling this method without an argument will return "Form1". If the tree node has several child node types, the method returns the string "object".

Examples

The following call to Treenode.newObjectName returns "object" because the data dictionary node has children that represent several object types.

{ 
    TreeNode t; 
    str s; 
 
    t = TreeNode::findNode("\Data dictionary"); 
    s = t.newObjectName(); 
    print s; 
    pause; 
}

See Also

TreeNode Class

TreeNode::generateObjectName Method