find_col_by_name

 

Description

To find column by long name, if not found then find column by short name.

Syntax

int find_col_by_name( Worksheet & wks, LPCSTR lpcszName )

Parameters

wks
[input] the worksheet to find column
lpcszName
[input] column long name or short name

Return

returns column index if found else return -1

Examples

void find_col_by_name_test()
{
    Worksheet wks = Project.ActiveLayer();
    String colname = "col2";
    int icolindex = find_col_by_name(wks, colname);
    if (icolindex >= 0)
        {
        printf("find the column, its index is %d", icolindex);
        }
    else printf("can't find the column");
}

Remark

See Also

header to Included

origin.h

Reference