Hi,
You can use the size of the range that would point to the column. e.g.:
range rCol = col(A);
int nIndex = rCol.GetSize();
nIndex=; // output just for testing.
However, this does not take into account if the last row (or rows) are missing values (--) which can readily happen.
To do that you'd have to do a simple loop backwards until encountering a value in the column that isn't a missing value:
range rCol = col(A);
int nSize = rcol.GetSize();
nIndex = 0;
for (int ii = nSize; ii > 0; ii--)
{
if (!ISNA(rCol[ii]))
{
nIndex = ii;
break;
}
}
nIndex=; // output just for testing.
I hope this helps.
Thanks,
Chris Drozdowski
Originlab Technical Support