Project::GetDataRange

Description

Get a datarange with name

Syntax

BOOL GetDataRange( DataRange & rg, LPCSTR lpcszName )

Parameters

rg
[output]a DataRange to receive data
lpcszName
[input]DataRange name

Return

Examples

//Add a datarange to project and get it.
void Project_GetDataRange_Ex1()
{
        //assume there is a worksheet with at least two columns
        Worksheet wks = Project.ActiveLayer();
        if ( !wks )
        {
                printf("Can not get active worksheet");
                return;
        }
        
        DataRange dr;
        dr.Add("X", wks, 0, 0, -1, 0);//add first column to datarange
        dr.Add("K", wks, 0, 1, -1, 1);//second column
        
        dr.SetName("XKRange");
        Project.AddDataRange(dr); //should add to Project before you can get it.
        Project.GetDataRange(dr, "XKRange");
        return;
}

Remark

See Also

Project::AddDataRange, Project::RemoveDataRange,DataRange::AddInput

header to Include

origin.h