Calculate

Calculates an expression

double Calculate(
        TCHAR           *calcstr,
        ProcUnit                *ptrProcUnit,
        int             *iError
)

Parameters
*calcstr
Expression
*ptrProcUnit
Pointer to the processing unit class
*iError
A pointer to the error code storage variable

Return Value
Calculation result

Description
Calculates the specified expression and stores the result.
Returns 0 if a syntax error or expression execution error (division by zero or no reference data) occurs. Also, the variable that was passed by Error argument is set to -1.

Notes