XYRange::GetData

Description

It extracts x, y, y error data from XYRange.

Syntax

BOOL GetData( vector & vy, vector & vx, vector * pvError = NULL, int nIndex = 0
, DWORD dwRulesEx = DRR_BAD_WEIGHT_TREATMENT
, vector<int> *pnMissingValsIndices = NULL, DWORD dwRules2 = 0 )

Parameters

vy
[output]the Y-independent data
vx
[output]the X independent data
pvError
[output]optional output of Y Error data
nIndex
[input]the data index
dwRulesEx
[input]the rules for extracting data from DRR_ enumeration.
pnMissingValsIndices
[output] the indices of missing value points if any.
dwRules2
bits from the DRR2_ enumeration.

Return

TRUE if success.

Examples

EX1

// This example assumes a worksheet with three columns is the active layer.
// Output the the data size of the Y column.
void XYRange_GetData_Ex1()
{
    Worksheet wks;
    wks= Project.ActiveLayer();
    XYRange dr;
    if( wks )
    {
        dr.Add(wks, 0, "X");
        dr.Add(wks, 1, "Y");
        dr.Add(wks, 2, "ED");
        
        DWORD dwRules = DRR_BAD_WEIGHT_TREATMENT;
        int nIndex = 0;
        vector vX, vY, vErr;
        if (dr.GetData(vY, vX, &vErr, nIndex, dwRules))
            printf("Data size is %d ", vY.GetSize());
    }    
}

Remark

See Also

XYRange::SetData, DataRange::GetNumData, DataRange::GetData, DataRange::SetData, DataRange::GetMaskedData, DataRange::GetMissingData

header to Include

origin.h