Spread 8.0 Documentation
Example
Support Options

Glossary Item Box

Example


The following example retrieves information about the first parameter of a custom function.

C++

Cstring sval;
ret = m_Spread.CFGetParamInfo(1, &wType, &wStatus);
if((ret==False)||(wStatus != ValueStatusOK))
    {
    MessageBox(NULL, "Parameter Error", "Notice", MB_OK);
    return;
    }
if(wType==ValueTypeString)
    sVal = m_Spread.CFGetStringParam(1);
else if(wType==ValueTypeLong)
    lVal = m_Spread.CFGetLongParam(1);
else if(wType==ValueTypeDouble)
    dfVal = m_Spread.CFGetDoubleParam(1);

Visual Basic

ret = fpSpread1.CFGetParamInfo(1, wType , wStatus )
If (ret = False) OR (wStatus != ValueStatusOK) Then
    MsgBox "Parameter Error", 48, "Notice"
    Exit Sub
End If
If wType = ValueTypeString Then
    Val = fpSpread1.CFGetStringParam(1)
Else If wType = ValueTypeLong Then
    Val = fpSpread1.CFGetLongParam(1)
Else If wType = ValueTypeDouble
    Val = fpSpread1.CFGetDoubleParam(1)
End If

© 2002-2014 ComponentOne, a division of GrapeCity. All Rights Reserved.