wks_find_empty_column

 

Description

Find first column of last empty range in the specified worksheet starting with the specified column.

Syntax

int wks_find_empty_column( Datasheet & wks, int nStartCol = 0 )

Parameters

wks
[input] The worksheet to search.
nStartCol
[input] The index of the column to start the search

Return

If last empty range is found return the index of first column else return -1.

Examples

EX1

int WksFirstEmptyColumn(LPCSTR lpcszWks)
{
    if( NULL == lpcszWks )
        return -1;
    Worksheet wks(lpcszWks);
    if( !wks )
        return -1;
    int nEmptyCol = wks_find_empty_column(wks);
    if( -1 == nEmptyCol )
        printf("No empty columns in %s\n", wks.GetName());
    else
        printf("First empty column in %s is column %d\n", wks.GetName(), nEmptyCol);
    return nEmptyCol;
}

Remark

See Also

Header to Include

origin.h

Reference