DataObjectBase::GetDatasetName

Description

A DataObjectBase object is always associated with a dataset inside Origin. Since Dataset is a template class, we use the name as the common mean of connecting to a Dataset.

Syntax

string GetDatasetName( )

Parameters

Return

The name of the specified Dataset

Examples

EX1

void DataObjectBase_GetDatasetName_ex1()
{
    Worksheet wks;
    wks.Create("origin");
    Dataset ds1(wks,0);
    Dataset ds2(wks,1);
    ds1.Data(1,20,1);
    ds2.Normal(20);

    GraphPage gp;
    gp.Create("origin");

    GraphLayer gl(gp.GetName(), 0);
    gl.AddPlot(wks);
    
    if(!gl)    
        return;

    int index = 1;
    foreach(DataPlot dp in gl.DataPlots)
    {
        printf("%3.0d:%s\n", index++, dp.GetDatasetName());
    }
}

Remark

See Also

Header to Include

origin.h