IPMath.Avg(IXMLDOMNodeList) Method

Definition

Gets the average value of all numerical elements in a node set.

public:
 System::Object ^ Avg(Microsoft::Office::Interop::InfoPath::SemiTrust::IXMLDOMNodeList ^ pxmllistInput);
public object Avg (Microsoft.Office.Interop.InfoPath.SemiTrust.IXMLDOMNodeList pxmllistInput);
abstract member Avg : Microsoft.Office.Interop.InfoPath.SemiTrust.IXMLDOMNodeList -> obj
Public Function Avg (pxmllistInput As IXMLDOMNodeList) As Object

Parameters

pxmllistInput
IXMLDOMNodeList

The node set that contains the values to be averaged.

Returns

An object that represents the average value of all the numerical elements in a node set.

Examples

In the following example, the variable averageAge is set to the average value of all of the numerical elements in the my:ages node set. my:ages is a simple field inside a repeating section or table.

IXMLDOMNodeList ages = thisXDocument.DOM.selectNodes("//my:ages");
   object averageAge = thisXDocument.Util.Math.<span class="label">Avg</span>(ages);
   thisXDocument.UI.Alert(averageAge.ToString());

Remarks

Important: This member can be accessed without restrictions.

Applies to