Dataset::SetLowerBound

Description

Set the lower display index of the Dataset.

Syntax

BOOL SetLowerBound( int nLower )

Parameters

nLower
[input]New lower display index of the Dataset

Return

Returns TRUE on successful exit and FALSE on failure.

Examples

EX1

void Dataset_SetLowerBound_ex1()
{
    // a Worksheet with at least 1 column must exist prior to execution
    Worksheet wks=Project.ActiveLayer();
    if (wks)
    {     
        Dataset    dsA(wks, 0);
        dsA.SetSize(10);
        for(int ii = 0; ii < 10; ii++)
            dsA[ii] = ii;
    
        dsA.SetLowerBound(2);
        dsA.SetUpperBound(7);
        BasicStats bsStatVal;
        Data_sum(&dsA, &bsStatVal);
        ASSERT( bsStatVal.min == 2 );
        ASSERT( bsStatVal.max == 7 );

        dsA.SetLowerBound(0);
        dsA.SetUpperBound(9);
        Data_sum(&dsA, &bsStatVal);
        ASSERT( bsStatVal.min == 0 );
        ASSERT( bsStatVal.max == 9 );
    }
}

Remark

Set the lower display index of the Dataset range. Index values are 0 based offsets. SetLowerBound is supported only for Datasets (not vectors) while GetLowerBound is supported for all vectorbase derived objects. This allows for creation of more general purpose functions that can take vectorbase objects as arguments in place of Dataset objects. Essentially, the lower bound can be read but not written for vectors. SetLowerIndex is a synonym for SetLowerBound.

See Also

vectorbase::GetLowerBound, vectorbase::GetSize, vectorbase::SetSize, vectorbase::GetUpperBound, Dataset::SetUpperBound

header to Include

origin.h