Initializing help system before first use

problem.evaluateformula

problem.evaluateformula


Purpose
Evaluate a formula using the current values of the variables
Synopsis
result = problem.evaluateformula (parsed, type, value)
Arguments
parsed 
integer indicating whether the formula of the item is in internal unparsed format ( Parsed=0) or parsed (reverse Polish) format ( Parsed=1).
type 
Integer array of token types for the formula.
value 
Double array of values corresponding to Type.
result 
The result of the calculation.
Example
The following example calculates the value of column 3 divided by column 6.
type  = [xp.xslp_op_var, xp.xslp_op_var, xp.xslp_op_op,       xp.xslp_op_eof]
value = [3,              6,              xp.xslp_ifun_divide, 0]

value = p.evaluateformula (1, type, value)

Further information

The formula in Type and Value must be terminated by an xslp_op_eof token.

The formula cannot include "complicated" functions, such as user functions which return more than one value.


Related topics