Share via


IPMath.Nz method

Gets the node set passed to the function, except with zeros (0) where empty values existed before.

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

Syntax

'Declaration
Function Nz ( _
    pxmllistInput As IXMLDOMNodeList _
) As Object
'Usage
Dim instance As IPMath
Dim pxmllistInput As IXMLDOMNodeList
Dim returnValue As Object

returnValue = instance.Nz(pxmllistInput)
Object Nz(
    IXMLDOMNodeList pxmllistInput
)

Parameters

Return value

Type: System.Object
An object that represents a node set.

Remarks

An exception occurs if there are no empty values in the node set.

Note

Accessing the object returned by the Nz 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 noZero is set to a node set that is identical to the my:ages node set, with all blank values replaced by zeros. This example is based on a repeating section with a field named "ages." An alert is shown for the XML generated for the first entry in the node list:

IXMLDOMNodeList ages = thisXDocument.DOM.selectNodes("//my:ages");
IXMLDOMNodeList noZero = (IXMLDOMNodeList)thisXDocument.Util.Math.Nz(ages);
thisXDocument.UI.Alert(noZero[0].xml.ToString());

See also

Reference

IPMath interface

IPMath members

Microsoft.Office.Interop.InfoPath namespace