DataObject::ReduceSize

Description

Skip the number of points(nSkip) to reduce data for Column or MatrixObject in nStart to nEnd range.

Syntax

int ReduceSize( int nSkip, DWORD dwCntrl, int nStart = 0, int nEnd = -1, int nBlockSize = 1 )

Parameters

nSkip
[input] number of points to skip, 1 will skip 1 point.
dwCntrl
[input] various combination of control bits (DORS_DEL_BEFORE_AFTER, DORS_UPDATE_SAMPLE_INTERVAL, DORS_UNDO).
nStart
[input] row index to start the procedure.
nEnd
[input] row index (inclusive), -1 if to go to the end.
nBlockSize
[input] after skipping nSkip points, take this number of points.

Return

Return 0 for no error.

Examples

EX1

// before running new a worksheet and fill in row numers with two columns
void DataObject_ReduceSize_Ex1()
{     
        Worksheet wks = Project.ActiveLayer();
        if(!wks)
                return;
        
        Column col(wks, 0);
        if(!col)
                return;
        
        // in 0-10 range, skip one per two items
        int nSkip = 1;
        col.ReduceSize(nSkip, DORS_DEL_BEFORE_AFTER, 0, 10, 2);
}

EX2

//before run this code, make sure there is an active matrix with row number, use formula Cell(i,j) = i to set value
void DataObject_ReduceSize_Ex2()
{
        MatrixLayer ml = Project.ActiveLayer();
        if ( !ml )
        {
                printf("Can not access active matrixsheet");
                return;
        }
        MatrixObject mo = ml.MatrixObjects(0); //get first matrixobject
        int nSkip = 1;
        //remove one row after every two rows through the matrix
        mo.ReduceSize(nSkip, DORS_DEL_BEFORE_AFTER, 0, -1, 2);
        return;
}

Remark

See Also

header to Include

origin.h