2.2.4.5.10 Column::GetDataObject

Description

Get the Dataset associated with a column as a vectorbase class reference.

Syntax

vectorbase & GetDataObject( )

Parameters

Return

a reference to the vectorbase class object for the associated dataset in the column.

Examples

EX1

// Active window should be a worksheet with data
void Column_GetDataObject_Ex1()
{
    Worksheet wks = Project.ActiveLayer();
    if( wks )
    {
        int ii = 1;
        foreach(Column cc in wks.Columns)
        {
            printf("Col(%d)'s name is %s\n",ii++, cc.GetName());
            if( cc.GetFormat() != OKCOLTYPE_TEXT )
            {
                vectorbase &aa = cc.GetDataObject();
                if( aa.GetSize() < 1 )
                    return;
                double vv;
                aa.Sum(vv);
                printf("sum of vector is %f\n", vv);
            }
        }
    }
}

Remark

Get the Dataset associated with a column as a vectorbase class reference

for using in functions that expect a vectorbase class. Using vectorbase will

allow the same function to be used on any data type.

See Also

Header to Include

origin.h