Create user defined function. The function raises an event on call. The function name will be forwarded to the event. Therefore you can create a sub for each function or one sub and then select by function name in event.
SubActivity_Create(FirstTimeAsBoolean)
MF_MathParser.CreateUserFunction("test", 2, "TestEvent")
DimresultAsDouble result = MF_MathParser.Parse("test(5,7)")
EndSub
SubTestEvent_Calc(nameAsString, values() AsDouble) AsDouble DimresultAsDouble = 0.0 ForEachvInValues result = result + v Next returnresult EndSub
Parse (formulaAsString) AsDouble
Parses the given formula and returns the result. Multiple formulas can be used, separated with ";". If a formula begins with "variable=", this variable will be set with the result. Additionally a variable "result" with the result value of the last formula will be set.