XYRange::GetXColumn

Description

To get X column of XYRange

Syntax

BOOL GetXColumn( Column & col, int nIndex = 0, int* pr1 = NULL, int* pr2 = NULL)

Parameters

col
[output]the X column
nIndex
[input]the data index
pr1
[output]if not NULL, will get row range
pr2
[output]if not NULL, will get row range

Return

TRUE if success.

Examples

EX1

//Asume there are three columns of data in the active worksheet.
//Output the sum value of X column data.
void XYRange_GetXColumn_Ex1()
{
    Worksheet wks;
    wks= Project.ActiveLayer();
    XYRange xyData;
    if( wks )
    {
        xyData.Add("X", wks, 0, 0, -1, 0);
        xyData.Add("Y", wks, 0, 1, -1, 1);
        xyData.Add("ED", wks, 0, 2, -1, 2);
 
        Column colX;
        int nIndex = 0;
        xyData.GetXColumn(colX, nIndex);
        vectorbase &vv = colX.GetDataObject();
        double dd;
        vv.Sum(dd);
        printf("sum of vector is %f\n", dd);    
    }    
}

Remark

See Also

XYRange::GetYColumn, XYRange::GetErrColumn

header to Include

origin.h