FWIW here's a unique values function I wrote a while ago:
/*
Function Name: get_unique_values
Description: Find the unique values in a list. Uses an associative array
Arguments:
in_list List to get unique values for
*/
Get_unique_values = Function( {in_list},
{Default Local},
tmp = [=> 0];
Insert Into( tmp, in_list );
tmp << get keys;
);
Sample calls:
a = {1, 1, 1, 2, 3, 3, 3};
b = get_unique_values(a);
print(b);
c = {"Hello", "World", "John", "Ed", "John", "World"};
d = get_unique_values(c);
print(d);
Output:
{1, 2, 3}
{"Ed", "Hello", "John", "World"}