Share via


IPMath.Eval method

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

Namespace:  Microsoft.Office.Interop.InfoPath
Assembly:  Microsoft.Office.Interop.InfoPath (in Microsoft.Office.Interop.InfoPath.dll)

Syntax

'Declaration
Function Eval ( _
    pxmllistContext As IXMLDOMNodeList, _
    bstrExpression As String _
) As Object
'Usage
Dim instance As IPMath
Dim pxmllistContext As IXMLDOMNodeList
Dim bstrExpression As String
Dim returnValue As Object

returnValue = instance.Eval(pxmllistContext, _
    bstrExpression)
Object Eval(
    IXMLDOMNodeList pxmllistContext,
    string bstrExpression
)

Parameters

  • bstrExpression
    Type: System.String

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

Return value

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

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.

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.Eval(items, "price * quantity"));

See also

Reference

IPMath interface

IPMath members

Microsoft.Office.Interop.InfoPath namespace