指定されたメンバーに対して式を設定します。
構文
EsbOtlSetMemberFormula ( hOutline, hMember, pszFormula ) ByVal hOutline As Long ByVal hMember As Long ByVal pszFormula As String
パラメータ | 説明 |
---|---|
hOutline |
アウトラインのコンテキスト・ハンドル。 |
hMember |
メンバーのハンドル。 |
pszFormula |
メンバー式を含むバッファ。 |
備考
メンバー式を削除するには、EsbOtlDeleteMemberFormula()を使用します。
戻り値
正常終了の場合は0が戻されます。それ以外の場合は、次のいずれかの値が戻されます:
OTLAPI_ERR_SHAREDMEMBERFORMULA
OTLAPI_ERR_MEMBERCALC
例
Declare Function EsbOtlSetMemberFormula Lib "ESBOTLN" (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
関連トピック