# EsbGetDefaultCalc

Description

EsbGetDefaultCalc() gets the default calc script for the active database.

Syntax

    EsbGetDefaultCalc (hCtx, cscString, szString)

    ByVal hCtx      As Long
    ByVal cscString As String
    ByVal szString  As Integer

Parameters

hCtx | Essbase VB API context handle.
cscString | Buffer to receive a calc script string.
szString | Size of the buffer to receive a calc script string.

Return Value

if successful, this function returns the default calc script for the database in CalcScript.

Notes

- The returned calc script string is less than 64 KBytes long.
- If the CalcScript length is greater that the size of the buffer, the script is truncated.

Access

This function requires the caller to have at least read access (ESB_PRIV_READ) to the database, and to have selected it as their active database using EsbSetActive().

Example

    Declare Function EsbGetDefaultCalc Lib "ESBAPIW" (ByVal hCtx As Long, ByVal Script As String, ByVal szScript As Integer) As Long

    Sub ESB_GetDefaultCalc ()
       Dim sts As Long
       Const szScript = 1024
       Dim Script As String * szScript

       '*****************
       ' Get default calc
       '*****************
       sts = EsbGetDefaultCalc (hCtx, Script, szScript)
    End Sub

See Also

EsbDefaultCalc()
EsbSetDefaultCalc()
EsbSetDefaultCalcFile()
EsbSetActive()