Scripts For Ingredient Variables

Examples of VBA scripts used for accessing ingredient related variables:

Example 1: Setting the purchasing price of an Ingredient

Function SetMaterialCost(cost)

Dim str As String

Dim var1 As Variant

str = CStr("Glucose")

var1 = CDbl(cost)

Set SuperProDoc = DocumentObject()

SuperProDoc.SetIngredientVarVal str, VarID.purchasingPrice_VID, var1

SetMaterialCost = CDbl(var1)

End Function

 

The above script is an example of a function used to set the purchasing price of a raw material (Glucose).