cnsAddTree

Allows to create a tree or sub-tree.

Synopsis

bool cnsAddTree(string cnsParentPath, dyn_dyn_string nameTree, dyn_dyn_langString displayNamesTree, dyn_dyn_string idTree, [dyn_dyn_int idTypeTree]);

Parameters

Parameter Description
cnsParentPath The path of the parent element (view, tree or node)
nameTree Defines the ID of a tree's nodes (see example)
displayNamesTree Defines the display names of a tree's nodes
idTree Defines the names of data points/data point elements which are linked to the nodes. If no data points shall be linked, an empty string must be passed.
idTypeTree Defines the CNSDataIdentifierType of the nodes

Return value

Returns TRUE if successful or FALSE in case of an error.

Errors

-

Description

This function creates a new tree or sub-tree which is added to the given parent element (can be a view, tree or node).

main()
{
  dyn_dyn_string nameTree;
  nameTree[1][1] = "A";
  nameTree[2][1] = ""; nameTree[2][2] = "B";
  nameTree[3][1] = ""; nameTree[3][2] = ""; nameTree[3][3] = "D";
  nameTree[4][1] = ""; nameTree[4][2] = ""; nameTree[4][3] = "E";
  nameTree[5][1] = ""; nameTree[5][2] = "C";

  dyn_dyn_langString displayNamesTree;
  displayNamesTree[1][1] = "Name A";
  displayNamesTree[2][1] = ""; displayNamesTree[2][2] = "Name B";
  displayNamesTree[3][1] = ""; displayNamesTree[3][2] = ""; displayNamesTree[3][3] = "Name D";
  displayNamesTree[4][1] = ""; displayNamesTree[4][2] = ""; displayNamesTree[4][3] = "Name E";
  displayNamesTree[5][1] = ""; displayNamesTree[5][2] = "Name C";
 
  dyn_dyn_string idTree;
  idTree[1][1] = "";
  idTree[2][1] = ""; idTree[2][2] = "";
  idTree[3][1] = ""; idTree[3][2] = ""; idTree[3][3] = "ExampleDP_Rpt1.";
  idTree[4][1] = ""; idTree[4][2] = ""; idTree[4][3] = "ExampleDP_Rpt2.";
  idTree[5][1] = ""; idTree[5][2] = "";

  dyn_dyn_int idTypeTree; //optional
  cnsAddTree("System1.View1:", nameTree, displayNamesTree, idTree, idTypeTree);
}

Availability

UI, CTRL