IPMath.Eval(IXMLDOMNodeList, String) Method

Definition

Gets the sets of results calculated when the expression is applied to each set of elements in the context.

public:
 System::Object ^ Eval(Microsoft::Office::Interop::InfoPath::Xml::IXMLDOMNodeList ^ pxmllistContext, System::String ^ bstrExpression);
public object Eval (Microsoft.Office.Interop.InfoPath.Xml.IXMLDOMNodeList pxmllistContext, string bstrExpression);
abstract member Eval : Microsoft.Office.Interop.InfoPath.Xml.IXMLDOMNodeList * string -> obj
Public Function Eval (pxmllistContext As IXMLDOMNodeList, bstrExpression As String) As Object

Parameters

pxmllistContext
IXMLDOMNodeList

The node that sets the context for the expression.

bstrExpression
String

The expression to be applied to each set of nodes in the specified context.

Returns

An object that represents the set of results calculated when the expression is applied to each set of elements in the context.

Examples

In the following example, the variable maxCost is set to the largest cost value, where cost is calculated by multiplying price by quantity.

IXMLDOMNodeList items = thisXDocument.DOM.selectNodes(@"/my:items/my:item");
decimal maxCost = (decimal) thisXDocument.Util.Math.Max((IXMLDOMNodeList) thisXDocument.Util.Math.<span class="label">Eval</span>(items, "price * quantity"));

Remarks

Note: Accessing the object returned by the Eval method by casting it to the IXMLDOMNodeList type in a managed form may result in security exceptions, in which case the form should be given FullTrust permissions.

Applies to