Currently, only vector and matrix can be used in an array, but Dataset and Matrix does not. Maybe you can use the CopyFromWks function in matrix class to construct a matrix from a range of worksheet cells and then process the data in that matrix.
The following function can be used to demonstrate this. change your custom.ogs as
[Main]
show_sel_stat;
void show_sel_stat()
{
Worksheet wks = Project.ActiveLayer();
if(!wks)
return;
int r1, c1,r2, c2;
int seltype = wks.GetSelectedRange(r1, c1, r2, c2);
if(WKS_SEL_NONE == seltype)
return;
matrix mm;
if(mm.CopyFromWks(wks, c1, c2, r1, r2))
{
printf("Selection %d x %d: mean = %f\n", mm.GetNumRows(), mm.GetNumCols(), mm.GetMean());
}
}
Once you compile this, can then select any data in a worksheet and hit the Custom Routine button.
CP
Edited by - cpyang on 10/15/2003 2:33:11 PM