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.
EsbBeginCalc (hCtx, isCalculate)
ByVal hCtx As Long ByVal isCalculate As Integer
| hCtx | Essbase VB API context handle. |
| isCalculate | Controls calculation of the calc script. If TRUE, the calc script is executed. |
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
EsbCalc()