Returns the logical AND of corresponding elements of two dynamic arrays.
function performs a logical AND test on the corresponding element values of dynarray1
. If both element values are non-zero numeric values, ANDS
returns 1 for that element. Otherwise, ANDS
returns 0. If a dynarray
element value is an empty string, a missing element, or a string containing any non-numeric character, ANDS
parses its value as 0.
A single leading plus or minus sign is parsed as a numeric character. Multiple leading plus and minus signs are treated as numeric characters in a number, but not in a numeric string. A numeric string with multiple leading plus and minus signs causes ANDS
to treat the element value as non-numeric.
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, the shorter dynamic array is padded with 0 value elements for the purpose of the logical comparison. You can also use the REUSE
function to define behavior when specifying two dynamic arrays with different numbers of elements.
The following example uses the ANDS
function to compare two dynamic arrays. It returns 1 when both element values are non-zero:
! returns 1ý0ý1ý0
The following example performs an AND test on two dynamic arrays of different lengths:
! returns 1ý0ý1ý0ý0ý0