2.2.3.6.8 Dataset::GetStringArray

Description

Copy the contents of a Text Dataset into a StringArray.

Syntax

BOOL GetStringArray( vector<string> & as, int nRow1 = 0, int nRow2 = -1 )

Parameters

as
[output] output StringArray
nRow1
[input] starting row number, default 0
nRow2
[input] ending row number, default -1 means to upper bound of Dataset

Return

Returns TRUE on successful exit and FALSE on failure.

Examples

EX1

void Dataset_GetStringArray_ex1()
{
    // This test function assumes a worksheet with 3 columns
    // first Column should have some number of text entries
    Worksheet wks=Project.ActiveLayer();
    if (wks)
    { 
        StringArray sa1, sa2;
        BOOL bRet;
        Dataset ds1(wks, 0);
        Dataset ds2(wks, 1);
        Dataset ds3(wks, 2);
        bRet = ds1.GetStringArray(sa1, 2, 5);
        bRet = ds1.GetStringArray(sa2);
        bRet = ds2.PutStringArray(sa1, 3);
        bRet = ds3.PutStringArray(sa2);
    }
}

Remark

This function is kept for compatibility reason only. It only works if you have correctly declare the Dataset to match internal column type. Better use the Column version of this function.

See Also

Column::PutStringArray, Column::GetStringArray, Dataset::PutStringArray

Header to Include

origin.h