Check whether all columns in selected data range have same data type or not.
bool check_cols_in_range_with_same_datatype( DataRange & dr, int * pType = NULL )
If same return ture, otherwise return false.
EX1
void check_cols_in_range_with_same_datatype_Ex1() { Worksheet wks; wks.Create("Origin"); if( wks ) { DataRange dr; dr.Add(wks, 0, "X"); dr.Add(wks, 1, "Y"); if(check_cols_in_range_with_same_datatype(dr)) // returns true since column default data type is double printf("columns in selected data range have same data type\n"); else printf("columns in selected data range have NOT same data type\n"); // set two columns to different data type wks.Columns(0).SetFormat(OKCOLTYPE_NUMERIC); wks.Columns(1).SetFormat(OKCOLTYPE_NUMERIC); wks.Columns(0).SetInternalDataType(FSI_LONG); wks.Columns(1).SetInternalDataType(FSI_DOUBLE); if(check_cols_in_range_with_same_datatype(dr)) // returns false printf("columns in selected data range have same data type\n"); else printf("columns in selected data range have NOT same data type\n"); } }
set_cols_in_range_to_same_datatype
origin.h