EssCalc

Sends 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);
ParameterData TypeDescription

hCtx

ESS_HCTX_T

API context handle.

Calculate

ESS_BOOL_T

Controls calculation of the calc script. If TRUE, the calc script is executed and the call is asynchronous.

CalcScript

ESS_STR_T

The calc script, as a single string (must be less than 64 KB).

Notes

Return Value

None.

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