2.2.4.46.27 Worksheet::GetBounds

Description

Get the minimum beginning and maximum ending row indices for the specified columns in this Worksheet.

Syntax

BOOL GetBounds( int & iR1, int iC1, int & iR2, int iC2, BOOL bIncludeMissingValues = TRUE )

Parameters

iR1
[output] Output minimum begining row index (0 based)
iC1
[input] Input begining column index(0 based)
iR2
[output]Output maximum ending row index (0 based)
iC2
[input] Input ending column index(0 based)
bIncludeMissingValues
[input] TRUE (default) will not modify iR1 and iR2.
FALSE will advance iR1 to first row with non-missing value and retard iR2 to last row with non-missing value.

Return

Returns TRUE on success and FALSE on failure.

Examples

EX1

void Worksheet_GetBounds_Ex1()
{
    Worksheet wks = Project.ActiveLayer();
    int nR1, nR2;
    
    wks.GetBounds(nR1, 0, nR2, -1);
    // need to convert to LabTalk indexing by +1
    printf("%s[%d:%d]\n", wks.GetPage().GetName(), nR1+1, nR2+1);
    // show for each column and check consistency
    foreach(Column cc in wks.Columns)
    {
        vector v(cc);
        printf("Col(%s)[%d:%d]\n",cc.GetName(), v.GetLowerBound()+1, v.GetUpperBound()+1);
    }
}

Remark

See Also

Worksheet::GetRange, Worksheet::SetBounds, Worksheet::SetLowerBound, Worksheet::SetUpperBound

Header to Include

origin.h