2.2.4.6.4 DataObject::GetFormula

Description

Get the formula of the DataObject.

Syntax

string GetFormula( )

Parameters

Return

String with the DataObject formula.

Examples

EX1

// Set column A with i+1 and column B with col(A)+i,
// this script report column formulas for active worksheet
void    DataObject_GetFormula_Ex1()
{
    Worksheet wks = Project.ActiveLayer();
    if(!wks)
        return;
 
    Column col;
    for( int ii = 0 ; ii < wks.GetNumCols() ; ii++ )
    {
        col.Attach(wks, ii);
        printf("Formula for column %u is %s\n", ii+1, col.GetFormula());
    }
}

Remark

To get the row range for the formula of the DataObject, you need to use IsFormulaAutoUpdate.

See Also

DataObject::SetFormula, DataObject::ExecuteFormula , DataObject::IsFormulaAutoUpdate

Header to Include

origin.h