Set all columns in selected data range to the same data type if columns have different data type.
int set_cols_in_range_to_same_datatype( DataRange & dr, int * pType = NULL )
if succeed return the type value, otherwise return -1.
EX1
void set_cols_in_range_to_same_datatype_Ex1() { Worksheet wks; wks.Create("Origin"); if( wks ) { DataRange dr; dr.Add(wks, 0, "X"); dr.Add(wks, 1, "Y"); // 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); int nRet = set_cols_in_range_to_same_datatype(dr); if(nRet < 0) printf("failed to set"); else printf("columns in selected data range are all set to same type \n" ); } }
check_cols_in_range_with_same_datatype
origin.h