2.1.14.4.4 is_column_in_bounds
Description
Check the column if is in the bound
Syntax
bool is_column_in_bounds( int nCol, vector<int> & vColLower, vector<int> & vColUpper )
Parameters
- nCol
- [input] column index, 0 offset.
- vColLower
- [input] subranges col lower bound vector.
- vColUpper
- [input] subranges col upper bound vector.
Return
Return true if in the bound, otherwise return false.
Examples
EX1
//For this example to run, make sure the active window is a workbook in current project.
bool is_column_in_bounds_Ex1(int nCol = 3)
{
//get source worksheet
Worksheet wks = Project.ActiveLayer();
//get wks' select range
vector<int> vr1, vc1, vr2, vc2;
int nSubRanges = wks.GetSelectedRange(vr1, vc1, vr2, vc2);
if(nSubRanges < 1)
return false;
//get wks' range
int c1 = 0;
int c2 = wks.GetNumCols() - 1;
int r1, r2;
wks.GetRange(r1, r2, c1, c2);
//to get subranges' bound
vector<int> vrLower, vrUpper;
if(!get_select_range_bounds(vr1, vr2, r2, vrLower, vrUpper))
return false;
vector<int> vcLower, vcUpper;
if(!get_select_range_bounds(vc1, vc2, c2, vcLower, vcUpper))
return false;
bool bRet = is_column_in_bounds(nCol, vcLower, vcUpper);
if(bRet)
printf("The %d column is in the bound", nCol);
else
printf("The %d column is out of the bound", nCol);
return bRet;
}
Remark
See Also
Header to Include
origin.h
Reference
|