Datasheet::SetMissingValue

Description

Set Missing Value to each Column or MatrixObjects in the specified range This function will not change internal data type, should just set missing value if nType matchs and immediately return if not

Syntax

int SetMissingValue( int nType, LPVOID pVal, int nC1 = 0, int nC2 = -1 )

Parameters

nType
[input] internal data type that the missing value, FSI_REAL, FSI_SHORT etc
pVal
[input] pointer to the missing value
nC1
[input] starting column or matrixobject index, 0 offset
nC2
[input] ending column or matrixobject index, -1 to the end

Return

return 0 if success, > 0 with 1-offset col index where it failed

return < 0 error code when col/mat type does not match nType and other error codes.

Examples

EX1

//Set the value of 1E-10 cells to missing value.
void Datasheet_SetMissingValue_Ex1()
{
    Worksheet wks;
    wks.Create();
    
    if(wks)
    {
        int nType = FSI_MIXED;
        double dMissing = 1E-10;
        int nRet = wks.SetMissingValue(nType, &dMissing);
        
        string strMessage = "Succeed to set missing value to workbook " + wks.GetPage().GetName();
        if(nRet > 0)
            strMessage = "Failed to set the " + ftoa(nRet) + "th Column";
        else if(nRet < 0)
            strMessage = "col/mat type does not match nType or other error";
        
        printf("%s\n", strMessage);
    }
}

Remark

See Also

header to Include

origin.h