This script contains the following information:
A sample statement written in the calling routine.
Variables set in the calling routine and passed to the Custom_Alloc function.
Variable names in the calling routine set to be the same as the Custom_Alloc function.
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