2.2.3.17.14 TreeNode::GetDataRange

Description

Gets a DataRange object from the TreeNode object which was previously saved using SetDataRanges

Syntax

BOOL GetDataRange( DataRange & dRange )

Parameters

dRange
[output] the DataRange object to be assigned

Return

TRUE is OK, otherwise failed.

Examples

EX1

void TreeNode_GetDataRange_ex1()
{
	//assume there exists active worksheet with at least three columns.
	Worksheet wks = Project.ActiveLayer();
	if ( wks )
	{
		DataRange dr;
		dr.Add(wks, 0, "X");
		dr.Add(wks, 1, "Y");
		dr.Add(wks, 2, "Z");
		
		Tree trInput;
		TreeNode trRange = trInput.AddNode("Range1");
		if ( trRange )
			trRange.SetDataRange(dr); //set before get
		
		DataRange drClone;
		if ( trRange.GetDataRange(drClone) )
			out_str("GetDataRange from treenode successfully.");
	}
}

Remark

See Also

TreeNode::SetDataRange

Header to Include

origin.h