check_each_subrange_same_row_num

 

Description

Check whether each subrange in selected data range has the same row number or not.

Syntax

bool check_each_subrange_same_row_num( DataRange & dr )

Parameters

dr
[input] The data range selected.

Return

return true if they have the same row number , otherwise false.

Examples

EX1

void check_each_subrange_same_row_num_Ex1()
{
        Worksheet wks;
        wks.Create("Origin");
        if( wks )
        {
                DataRange dr;
                dr.Add(wks, 0, "X");
                dr.Add(wks, 1, "Y");
                
                if(check_each_subrange_same_row_num(dr))// returns true since subranges have the same row number
                        printf("each subrange in selected data range has the same row number\n");
                else
                        printf("each subrange in selected data range does not have the same row number\n");
                
                // add a new column who has the different row number
                wks.AddCol("C");
                int rownum = 1;
                dr.Add("Z", wks, 0, 3, rownum, 1); 
                if(check_each_subrange_same_row_num(dr))// returns false since new added subrange have the different row number
                        printf("each subrange in selected data range has the same row number\n");
                else
                        printf("each subrange in selected data range does not have the same row number\n");
        
        }
}

Remark

See Also

header to Include

origin.h

Reference