2.1.7.4 find_input_range_bounding_box


Description

Find out the correct column range, row range and corresponding worksheet according to the range name.

Syntax

int find_input_range_bounding_box( const DataRange & rngInput, int & r1, int & c1, int & r2, int & c2, Worksheet & wksFirst, LPCSTR lpcszType )


bool find_input_range_bounding_box( const DataRange & rngInput, int & r1, int & c1, int & r2, int & c2, Worksheet & wks, int nDataIndex, string strTypeSeparator = "Y" )

Parameters

rngInput
[input] The DataRange from which user wants to get values.
r1
[output] Begin Row index of the DataRange.
c1
[output] Begin Column index of the DataRange.
r2
[output] End Row index of the DataRange.
c2
[output] End Column index of the DataRange.
wksFirst
[output] Corresponding worksheet of the DataRange.
lpcszType
[input] Range type name stands for sub range.
wks
[output] Corresponding worksheet of the DataRange.
nDataIndex
[input] DataRange index will be gotten, return true when the DataRange index equal to this.
strTypeSeparator
[input] Range type name stands for sub range.

Return

if the DataRange is found, return the correct DataRange index, else return 0.


if the DataRange is found, return true, else return false.

Examples

EX1

void find_input_range_bounding_box_Ex1()
{
	Worksheet wks;
	wks.Create("Origin");
	if( wks )
	{
		DataRange dr;
		int nXRowEnd = 10;
		dr.Add("X", wks, 0, 0, nXRowEnd, 0); 
		dr.Add("Y", wks, 0, 1, -1, 1); 
		
		Worksheet wksRet;
		int nrc[4];
		int  nRet ;
		nRet = find_input_range_bounding_box(dr, nrc[0], nrc[1], nrc[2], nrc[3], wksRet, "X");
		//Get the range bound of subrange "X".  
		//Begin Row is 0, End Row is 10, Begin column is 0, End column is 0
		printf("Begin Row is %d,  End Row is %d  , Begin column is %d , End column is %d  \n" , nrc[0], nrc[2], nrc[1], nrc[3], nRet);
		
	}

}

Remark

See Also

Header to Include

origin.h

Reference