IPMath.Avg(IXMLDOMNodeList) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets the average value of all numerical elements in a node set.
public:
System::Object ^ Avg(Microsoft::Office::Interop::InfoPath::Xml::IXMLDOMNodeList ^ pxmllistInput);
public object Avg (Microsoft.Office.Interop.InfoPath.Xml.IXMLDOMNodeList pxmllistInput);
abstract member Avg : Microsoft.Office.Interop.InfoPath.Xml.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());