To find column by long name, if not found then find column by short name.
int find_col_by_name( Worksheet & wks, LPCSTR lpcszName )
returns column index if found else return -1
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"); }
origin.h