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.SemiTrust
Assembly:  Microsoft.Office.Interop.InfoPath.SemiTrust (in Microsoft.Office.Interop.InfoPath.SemiTrust.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.

Important

This member can be accessed without restrictions.

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.SemiTrust Namespace