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

hOutlineOutline context handle.
hMemberMember handle.
pszFormulaBuffer containing the member formula.

Return Value

Returns 0 if successful; otherwise one of the following:

OTLAPI_ERR_SHAREDMEMBERFORMULA
OTLAPI_ERR_MEMBERCALC

Notes

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()