Nz Method

Microsoft Office InfoPath

Returns a Variant that is identical to the node set passed to the function, except empty values in the node list are replaced with zeros (0).

expression.Nz(ByVal pxmllistInput As IXMLDOMNodeList) As Variant

expression    Required. An expression that returns a reference to the Math object.

pxmllistInput    Required. The node set that will have its empty values replaced with zeroes.

returns    A Variant that represents a node set.

Security Level

0: Can be accessed without restrictions.

Remarks

Note  This object model member is not supported when the Disable Service Pack features option on the Advanced tab of the Options dialog box in InfoPath is selected or when Microsoft Office 2003 Service Pack 1 or later is not installed. Any form that implements this object model member in its code will generate an error message if it is opened in InfoPath when service pack features are disabled or unavailable.

Example

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:

var ages = XDocument.DOM.selectNodes("//my:ages");
var noZero = XDocument.Util.Math.Nz(ages);