Skip to main content
Previous sectionNext section

NES

Performs an inequality comparison on elements of two dynamic arrays.

Synopsis

NES(dynarray1,dynarray2)

Arguments

dynarray An expression that resolves to a dynamic array of numeric values.

Description

The NES function (not equals) compares each corresponding numeric element from two dynamic arrays for inequality. It returns a dynamic array of boolean values, in which each element comparison is represented by a 1 (not equal) or a 0 (equal). NES removes signs and leading and trailing zeros from element values before making the comparison. If an element is missing, or has a null string or non-numeric value, NES assigns it a value of 0 for the purpose of this comparison.

For two elements to be compared, they must be on the same dynamic array level. For example, you cannot compare a value mark (@VM) dynamic array element to a subvalue mark (@SM) dynamic array element.

If the two dynamic arrays have different numbers of elements, the returned dynamic array has the number of elements of the longer dynamic array. By default, unmatched elements return 1 (not equal). That is, the NES comparison of each element in the longer dynamic array that has no corresponding element in the shorter dynamic array always returns 1 (not equal), even when the value of the longer array element is 0 or the null string, or is a missing element within the dynamic array. You can also use the REUSE function to define behavior when specifying two dynamic arrays with different numbers of elements.

The NES function is the functional opposite of the EQS function.

Examples

The following example uses the NES function to return a not equals comparison for each of the elements in dynamic arrays a and b:

a=11:@VM:-22:@VM:-33:@VM:44
b=11:@VM:-24:@VM:0:@VM:44
PRINT NES(a,b)
      ! returns 0ý1ý1ý0
Copy code to clipboard

See Also