2.2.4.10.2 DataRangeEx::Create

Description

Create a DataRangeEx object by a treenode containing data information.

Syntax

bool Create( TreeNode & tr, bool bOneData = true )

Parameters

tr
[input]the tree containing the range data
bOneData
[input]TRUE means only one range is added to tree. False means add multiple ranges.

Return

Examples

//This example shows how to create a DataRangeEx object by a treenode containing data information.
void DataRangeEx_Create_Ex1()
{
    //assume the active workbooka sheet and has two columns before run this code.
    Worksheet wks = Project.ActiveLayer();
    if ( !wks )
    {
        printf("Can not find any active worksheet!");
        return;
    }
    DataRange dr;
    dr.Create();//init the object
    dr.Add("X", wks, 0, 0, -1, 0);
    dr.Add("Y", wks, 0, 1, -1, 1);
    Tree trData;
    dr.GetTree(trData);
    
    DataRangeEx drEx;
    drEx.Create(trData, true);
    return;
}

Remark

See Also

Header to Include

origin.h