2.2.4.11.4 DatasetObject::GetElementTypes


Description

Get the format type of each element from the mixed type DatasetObject.

Syntax

bool GetElementTypes( vector<uint> & vnTypes, int i1 = 0, int i2 = -1 )

Parameters

vnTypes
[output] a vector contains the format type of each element, possible value : OKCOLTYPE_NUMERIC, OKCOLTYPE_TEXT
See the definitions of OKCOLTYPE in OC_Const.h .
i1
[input] the begin index of row.
i2
[input] the end index of row.

Return

TRUE on success and FALSE on failure.

Examples

EX1

void DatasetObject_GetElementTypes_Ex1()
{
    Worksheet wks = Project.ActiveLayer();
    if( !wks )
        return;

    Column col = wks.Columns(0);
    DatasetObject obj(col);

    vector<uint> vTypes;
    if ( obj && obj.GetElementTypes(vTypes) )
    {
        for(int ii = 0; ii < vTypes.GetSize(); ii++)
            if (OKCOLTYPE_TEXT == vTypes[ii])
                printf("Row %d is Text\n", ii+1);
    }
    else
        out_str("fail to get element types.");
}

Remark

See Also

Header to Included

origin.h