Peter, you are right,
wks.Cell(Row,Col)
should be able to handle missing value, we will need to fix this.
Trackered as 5219
In the meantime, you can write a separate function to get a cell value, as shown below,
double wks_cell(Worksheet & wks, int nr, int nc)
{
double vv = NANUM;
if(nr < 0 || nr >= wks.GetNumRows() || nc < 0 || nc >= wks.GetNumCols())
return vv;
try {
vv = wks.Cell(nr, nc);
}
catch(int nErr)
{
// put codes here if err handling is needed
}
return vv;
}
void test_check_wks_missing()
{
Worksheet wks = Project.ActiveLayer();
for(int ii = 0; ii < wks.GetNumCols(); ii++)
{
for(int jj = 0; jj < wks.GetNumRows(); jj++)
{
double vv = wks_cell(wks, jj, ii);//wks.Cell(jj, ii);
if(is_missing_value(vv) || vv < 2)
{
string str = wks.TCell(jj, ii);
printf("Cell(%d,%d) is no good, it is \"%s\"\n", jj, ii, str);
}
}
}
}
CP
Edited by - cpyang on 09/22/2003 6:35:11 PM