Equation examples

Here are some examples of equations using ObjPropertySet.

This script sets the value of the LABCOST parameter to 50.


Dim lSet As Long
ObjPropertySet(50,0,"VALUE.TP3","","","LABCOST",2)

This script retrieves the lowest status of all the ingredients in a formula and the status of the formula. It compares the lowest ingredient status to the formula status. If the ingredient status is lower than the formula status, then the formula is reset to the lowest ingredient status.


Dim oIngrStatus As Object
ObjMethod("", "","INGRLOWESTSTATUS")
Dim oFStatus As Object = ObjProperty("STATUSIND.STATUS","","")
if (oIngrStatus < oFStatus) then
   MessageList("Ingredient status lower than specified formula status.")
   MessageList("Formula status set to lowest ingredient status.")
   ObjPropertySet(oIngrStatus,0,"STATUSIND.STATUS","","")
end if