Subscribe Bookmark RSS Feed

[JSL] How can i know the number of values in my list ?

antoinesofradir

Community Trekker

Joined:

Apr 26, 2013

Hello,

I have a list with lots of values and i would like to know, how many values are there in this list ?

Thanks for your help !

1 ACCEPTED SOLUTION

Accepted Solutions
Solution

N Items(list)

2 REPLIES
Solution

N Items(list)

pmroz

Super User

Joined:

Jun 23, 2011

If you need to know the number of unique values in the list here's a handy function:

Get_unique_values = Function( {in_list},

{Default Local},

tmp = [=> 0];

Insert Into( tmp, in_list );

tmp << get keys;

);

To use it, first compile the function, and then call it like this:

my_list = {"aa", "bb", "bb", "cc", "cc"};

print(get_unique_values(my_list);

{"aa", "bb", "cc"}