EssGetProcessState

Gets the current state of an asynchronous process, such as a calculate or a data import.

 

Syntax

ESS_FUNC_M EssGetProcessState (hCtx, pProcState);
ParameterData TypeDescription

hCtx

ESS_HCTX_T

API context handle.

pProcState

ESS_PROCSTATE_T

Pointer to process state structure

Notes

Return Value

If this function is unable to get the process state, an error is returned. If the process terminates because of an error, then its error code is returned. Otherwise, this function returns ESS_STS_NOERR, and the current process state is given in the state structure pProcState. Values for pProcState:

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