# EsbOtlSetMemberFormula

Description

EsbOtlSetMemberFormula() sets the formula for a specified member.

Syntax

    EsbOtlSetMemberFormula (hOutline, hMember, pszFormula)

    ByVal hOutline   As Long
    ByVal hMember    As Long
    ByVal pszFormula As String

Parameters

hOutline | Outline context handle.
hMember | Member handle.
pszFormula | Buffer containing the member formula.

Return Value

Returns 0 if successful; otherwise one of the following:

OTLAPI_ERR_SHAREDMEMBERFORMULA
OTLAPI_ERR_MEMBERCALC

Notes

- Use EsbOtlDeleteMemberFormula() to remove a member formula.

Example

    Declare Function EsbOtlSetMemberFormula Lib
    "ESBOTLW" (ByVal hOutline As Long, ByVal hMember As Long,
    ByVal pszFormula As String) As Long

    Sub ESB_OtlSetMemberFormula()
    Dim sts As Long
    Dim Object As ESB_OBJDEF_T
    Dim hOutline As Long
    Dim hMemberProfit As Long
    Dim szFormula as String * 100

    Object.hCtx = hCtx
    Object.Type = ESB_OBJTYPE_OUTLINE
    Object.AppName = "Sample"
    Object.DbName = "Basic"
    Object.FileName = "Basic"

    sts = EsbOtlOpenOutline(hCtx, Object,
    ESB_YES, ESB_YES, hOutline)

    If sts = 0 Then
       sts = EsbOtlFindMember(hOutline, "Profit",
        hMemberProfit)
    End If

    If sts = 0 hMemberProfit <> 0 Then
       szFormula = "Profit = Gross / Margin;"
       sts = EsbOtlSetMemberFormula(hOutline,
        hMemberProfit, szFormula)
    End If
    End Sub

See Also

EsbOtlGetMemberFormula()
EsbOtlDeleteMemberFormula()