サンプル・スクリプト

このスクリプトには、次の情報が含まれます:

  • 呼出しルーチンで記述されたサンプル文。

  • 呼出しルーチンに設定され、Custom_Alloc関数に渡される変数。

  • Custom_Alloc関数と同一になるように設定された呼出しルーチンの変数名。

    Sub Calculate()
    Dim Destination
    Dim Source
    Dim Elimination
    Dim Factor
    Dim FactorN
    Dim FactorD
    Dim C1list
    Dim C1item
    C1list = HS.Custom1.List("Alloc")
    For Each C1item in C1list  
    Source = "A#Telephone.C1#[None]"
    Destination = "A#Telephone.C1#" & C1item
    Factor = "A#Factor.C1#" & C1item
    FactorN = "A#Sales.C1#" & C1item
    FactorD = "A#Sales.C1#TotalProducts"
    Elimination = "A#ProductAllocations.C1#" & C1item 
    Call Custom_Alloc(Destination,Source,Factor,FactorN,
    FactorD,Elimination)
    Next 
    End Sub
    ' Beginning of the Custom_Alloc function 
    Sub Custom_Alloc(Destination,Source,FactorN,FactorD,
    Elimination)
    HS.Clear Factor
    HS.Exp Factor & " = " & FactorN & "/" & FactorD
    HS.EXP Destination & " = " & Source & " * " & Factor 
    If Elimination <> "" Then
    HS.EXP Elimination & " = " & Source & " * -1 * " & Factor
    End If
    End Sub