DataObject::GetMissingValue

Description

Get the missing value of the DataObejct.

Syntax

BOOL GetMissingValue( LPVOID pVal )

Parameters

pVal
[input] point to the data to get the missing value. Please check to make sure it is not NULL. Returns false if no missing value is defined.

Return

Returns true if missing value define in this data object.

Examples

EX1

void DataObject_GetMissingValue_Ex1()
{
    WorksheetPage     wksPage;
    wksPage.Create("origin");
    Worksheet     wks = wksPage.Layers();
 
    Column     col(wks, 0);
    if(col)
    {
        vector& vec = col.GetDataObject();
        double     dMissing = 1e-10; // defined by user
        vec.Data(1, 10, 1);
        vec[0] = dMissing;
        col.SetMissingValue(&dMissing);
        Dataset ds(col);
        bool    bb = col.GetMissingValue(&dMissing);
                if(bb)
                {
                        string str;
                        str.Format("missing value define as %f\n", dMissing);
                        out_str(str);
                }
                else
                        out_str("no missing value defined. Can use DataObject::SetMissingValue to set.");
    }
}

EX2

void DataObject_GetMissingValue_Ex2()
{
        MatrixPage mp;
        mp.Create("origin");
    MatrixLayer ml = Project.ActiveLayer();
    if ( !ml )
    {
        printf("Can not access active matrixsheet");
        return;
    }
    MatrixObject mo = ml.MatrixObjects(0); //get first matrixobject
    double dMiss = 1e-12;
    mo.SetMissingValue(&dMiss);
        if ( mo.GetMissingValue(&dMiss) )
        printf("Missing value defined as %.10lf\n", dMiss);
    else
        printf("No missing value defined for the matrixobject");
}

Remark

See Also

DataObject::SetMissingValue

header to Include

origin.h