EsbBeginCalc

Description

EsbBeginCalc() starts sending a calc script and optionally executes it against the active database. This call must be followed by successive calls to EsbSendString() to send the calc script, and finally by a call to EsbEndCalc(). The Calc Script must be less than 64 KBytes long in total. The calculation can either be initiated, or the calc script can just be verified and any errors returned.

Syntax
EsbBeginCalc (hCtx, isCalculate)
ByVal hCtx        As Long
ByVal isCalculate As Integer

Parameters

hCtxEssbase VB API context handle.
isCalculateControls calculation of the calc script. If TRUE, the calc script is executed.

Return Value

None.

Notes

Access

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

Example

Declare Function EsbBeginCalc Lib "ESBAPIW" (ByVal hCtx As Long, ByVal Calculate As Integer) As Long
Sub ESB_BeginCalc ()
   Dim sts As Long
   Dim Script As String 
   Dim Calculate As Integer
   Dim ProcState As ESB_PROCSTATE_T
   Script = "CALC ALL;"
   Calculate = ESB_YES
   '***********
   ' Begin Calc
   '***********
   sts = EsbBeginCalc (hCtx, Calculate)
   '***********************
   ' Send Calc script
   '***********************
   sts = EsbSendString (hCtx,Script)
   '*********
   ' End Calc 
   '*********
   sts = EsbEndCalc (hCtx)
   '************************************
   ' Check process state until it is done 
   '************************************
   sts = EsbGetProcessState (hCtx, ProcState)
    Do Until ProcState.State = ESB_STATE_DONE 
      sts = EsbGetProcessState (hCtx, ProcState)
   Loop 
End Sub

See Also

EsbCalc()
EsbCalcFile()
EsbDefaultCalc()
EsbEndCalc()
EsbGetDefaultCalc()
EsbGetProcessState()
EsbSendString()
EsbSetDefaultCalc()