vector::GetSourceRange

Description

gets the range inside the source data when the constructor vector(Column& cc, int nLowerIndex = -1, int nUpperIndex = -1, int nWriteback = WRITEBACK_NO) is used. Click here to see that constructor and the accompanying example for more details.

Syntax

bool GetSourceRange( int & nLower, int & nUpper )

Parameters

nLower
[output] receives the value of the lower index in used the source
nUpper
[output] receives the value of the upper index in used the source

Return

TRUE if nWriteback was not WRITEBACK_NO when calling the vector's constructor.

Examples

EX1

int    vector_GetSourceRange_ex1()
{
    // Have some data in the second column of the current worksheet before running this example.
    Worksheet wks=Project.ActiveLayer();
    Column        col(wks, 1);
    vector        v(col, 2, 5, WRITEBACK_DELETE_ON_SHRINK | WRITEBACK_INSERT_ON_EXPAND);
    
    // Dump the source range
    int            nSrcLowerIndex, nSrcUpperIndex;
    if (v.GetSourceRange(nSrcLowerIndex, nSrcUpperIndex))
        printf("nSrcLowerIndex = %ld\tnSrcUpperIndex = %ld\n", nSrcLowerIndex, nSrcUpperIndex);
    
    // Modify the vector:
    int            nNewVectorSize = 80;
    v.SetSize(nNewVectorSize);
    for (int ii = 0; ii < nNewVectorSize; ii++)
    {
        v[ii] = 100 * (ii + 1);
    }

    return 0;
}

Remark

See Also

header to Include

origin.h