EssCalc

Description

EssCalc() sends and optionally executes a calc script against the active database as a single string. This function is equivalent to making a call to EssBeginCalc(), followed by calls to EssSendString(), and finally to EssEndCalc(). The calculation can either be initiated, or the calc script can just be verified and any errors returned.

Syntax

ESS_FUNC_M EssCalc (hCtx, Calculate, CalcScript);
ESS_HCTX_ThCtx
ESS_BOOL_TCalculate
ESS_STR_TCalcScript

Parameters

hCtxEssbase API context handle.
CalculateControls calculation of the calc script. If TRUE, the calc script is executed.
CalcScriptThe calc script, as a single string (must be less than 64 Kbytes).

Return Value

None.

Notes

Access

This function requires the caller to have calc privilege (ESS_PRIV_CALC) to the active database.

Example

ESS_FUNC_M
ESS_CalcLine   (ESS_HCTX_T            hCtx)
{
   ESS_FUNC_M        sts = ESS_STS_NOERR;
   ESS_STR_T        Script;
   ESS_PROCSTATE_T  pState; 
   
   Script = "CALC ALL;";
   sts = EssCalc(hCtx, ESS_TRUE, Script);
   if (!sts)
   {
      sts = EssGetProcessState (hCtx, &pState);
      while (!sts || (pState.State != 
              ESS_STATE_DONE))
        sts = EssGetProcessState (hCtx, &pState);      
   }
   return(sts);
}

See Also

EssBeginCalc()
EssCalcFile()
EssDefaultCalc()
EssEndCalc()
EssGetDefaultCalc()
EssGetProcessState()
EssSendString()
EssSetDefaultCalc()