Removes duplicate elements from an Array.
ArrayUnique( sourceArray [ ,compMethod ])
sourceArray
Array of any type.
compMethod
Optional Integer specifying the type of comparison to use when searching for the delimiter, if the elements are strings.
Number |
Comparison Mode |
---|---|
0 |
case sensitive, pitch sensitive |
1 |
case insensitive, pitch sensitive |
4 |
case sensitive, pitch insensitive |
5 |
case insensitive, pitch insensitive |
If you omit compMethod, the default comparison mode is the mode set by the Option Compare statement for this module. If there is no statement for the module, the default is case sensitive and pitch sensitive.
Returns an array with duplicates removed. For any elements of the array which compare equal, the first occurrence is copied into the result array.
Elements in a variant array will only compare equal if they are of the same type. The variant array can't contain classes or objects.
Array elements that contain the null value will match other null values.
Array elements that are empty will match with other elements that are empty.
Error handling
ArrayUnique throws a Run-time Type mismatch if:
ArrayUnique throws a run-time Wrong Number of Dimensions error if the array is not one-dimensional.
@Unique function in formula language