2.2.3.5.13 curvebase::TrimRight

Description

TrimRight removes elements having the value NANUM from the right end of a Curve.

Syntax

int TrimRight( BOOL bDelExtra = FALSE )

Parameters

bDelExtra
[input] TRUE will delete cells on the right of (after) the last valid numeric value, FASLE will cause the upper bound or index to be adjusted downward but no cells are deleted.

Return

Returns -1 on error, 0 on success, and N > 0 for number of cells deleted.

Examples

EX1

int curvebase_TrimRight_ex1(string wksName = "Book1")
{
    Worksheet wks(wksName);
    if(wks)
    {
        Curve    crv(wks,1);
        crv.TrimRight(TRUE);
    }
    return 0;
}

EX2

int curvebase_TrimRight_ex2(string wksName = "Book1")
{
    Worksheet wks(wksName);
    if(wks)
    {
        Curve crv(wks,1);
        out_int("Upper bound before trimright is: ",crv.GetUpperBound());
        crv.TrimRight();
        out_int("Upper bound after trimright is: ",crv.GetUpperBound());
    }
    return 0;
}

Remark

TrimRight removes elements having the value NANUM from the right end or bottom of the Curve by retarding the upper index to the last valid umeric value. When bDelExtra is TRUE TrimRight of Curve objects causes both X and Y Datasets to be trimmed.

See Also

curvebase::TrimLeft, vectorbase::GetUpperBound

Header to Include

origin.h