ArrayUnique function (LotusScript® Language)

Removes duplicate elements from an Array.

Note: This function is new with Domino® Release 6.

Syntax

ArrayUnique( sourceArray [ ,compMethod ])

Elements

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.

Return value

Returns an array with duplicates removed. For any elements of the array which compare equal, the first occurrence is copied into the result array.

Usage

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:

  • the first parameter is not an array
  • a list is passed instead of an array
  • the array passed in has not been properly initialized
  • the array is of classes
  • the array is of NotesDocuments
  • the array contains an array as an element
  • the array contains nothing as an element

ArrayUnique throws a run-time Wrong Number of Dimensions error if the array is not one-dimensional.

See examples

Examples: ArrayUnique function