Caché MultiValue Basic Reference
ABSS
[Home] [Back] [Next]
InterSystems: The power behind what matters   
Class Reference   
Search:    

Returns the absolute value of each element in a dynamic array.
Synopsis
ABSS(dynarray)
Arguments
dynarray An expression that resolves to a dynamic array containing numeric elements.
Description
The ABSS function returns a dynamic array containing the absolute value of each numeric element of dynarray. The absolute value of a number is its unsigned magnitude. ABSS returns numbers in canonical form; it removes signs, and leading and trailing zeros from the element values. If a dynarray element is a missing element, an empty string, or a non-numeric value, ABSS returns a value of 0 (zero) for that element.
Examples
The following example uses the ABSS function to return the absolute value of each of the numbers in a dynamic array:
a = 11:@VM:-22:@VM:-33:@VM:44
PRINT a;          ! returns 11ý-22ý-33ý44
PRINT ABSS(a);    ! returns 11ý22ý33ý44
The following example uses the ABSS function with a dynamic array that has missing and non-numeric elements:
b = -11:@VM:"":@VM:"-7dwarves":@VM:@VM:"dwarves"
PRINT ABSS(b);    ! returns 11ý0ý7ý0ý0
See Also