EssGetProcessState

Description

EssGetProcessState() gets the current state of an asynchronous process, such as a calculate or a data import.

Syntax

ESS_FUNC_M EssGetProcessState (hCtx, pProcState);
ESS_HCTX_ThCtx
ESS_PPROCSTATE_T pProcState

Parameters

hCtxEssbase API context handle.
pProcStatePointer to process state structure

Return Value

If successful, returns the current process state in the state structure pProcState. Values for pProcState:
ESS_STATE_DONE: 0 = Done
ESS_STATE_INPROGRESS: 1 = In progress
ESS_STATE_FINALSTAGE: 5 = In final stage; cannot be canceled

Notes

Access

This function requires no special privilege.

Example

ESS_FUNC_M
ESS_RunCalc (ESS_HCTX_T  hCtx)
{
   ESS_FUNC_M      sts = ESS_STS_NOERR;
   ESS_SHORT_T    isResponse;
   ESS_HCTX_T   hSrcCtx;
   ESS_BOOL_T   isObject = ESS_FALSE; 
   ESS_STR_T    AppName;
   ESS_STR_T    DbName;
   ESS_STR_T    FileName;
   ESS_PROCSTATE_T pState;
   
   hSrcCtx  = hCtx;
   AppName  = "Sample";
   DbName   = "Basic";
   FileName = "Test"; 
   
   sts = EssCalcFile (hCtx, hSrcCtx, AppName,
         DbName, FileName, ESS_TRUE);
   if (!sts)
   {
      sts = EssGetProcessState (hCtx, &pState);
      while(!sts || (pState.State != 
             ESS_STATE_DONE))
         sts = EssGetProcessState (hCtx, &pState);
   }
   return(sts);
}

See Also

EssBeginCalc()
EssCalc()
EssCancelProcess()
EssImport()