IPMath.Avg(IXMLDOMNodeList) Method

Definition

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

C#
public object Avg (Microsoft.Office.Interop.InfoPath.Xml.IXMLDOMNodeList pxmllistInput);

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());

Applies to

Produkt Verzie
InfoPath form templates Latest