# EssEndCalc

Description

EssEndCalc() marks the end of a calc script being sent to the active database. This function must be called after sending the calc script (using EssSendString()).

Syntax

    ESS_FUNC_M EssEndCalc (hCtx);

ESS_HCTX_T | hCtx

Parameters

hCtx | Essbase API context handle.

Return Value

None.

Notes

- This function must be preceded by a call to EssBeginCalc(), and at least one call to EssSendString().
- If the calls to EssBeginCalc(), EssSendString(), and EssEndCalc succeed, the caller must check at regular intervals to see if the process has completed by calling EssGetProcessState() until it returns ESS_STATE_DONE.

Access

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

Example

    ESS_FUNC_M
    ESS_Calc   (ESS_HCTX_T         hCtx)
    {
       ESS_FUNC_M          sts = ESS_STS_NOERR;
       ESS_STR_T         Script;
       ESS_PROCSTATE_T   pState;
       Script = "CALC ALL;";

       sts = EssBeginCalc (hCtx,ESS_TRUE);
       if (!sts)
          sts = EssSendString (hCtx, Script);
       if (!sts)
          sts = EssEndCalc (hCtx);
       if (!sts)
       {
          sts = EssGetProcessState (hCtx, &pState);
          while (!sts || (pState.State !=
                 ESS_STATE_DONE))
            sts = EssGetProcessState (hCtx, &pState);
       }
       return(sts);
    }

See Also

EssBeginCalc()
EssCalc()
EssSendString()