
![]() |
Welcome Guest ( Log In | Register ) ![]() |
![]() ![]() ![]() |
dynamo |
Posted: Jan 15 2008, 11:03 AM
|
![]() |
Hello,
I am trying to find an easy way to remove duplicates from a list (probably a function that I can use over and over again). So far I tried the following: list (n1,n2,n3,n4,n2) list2(n1, if(n2 <> n1, n2, ""), if (n3 <> n1 and n3 <> n2, n3,"")....). I know there must be an easier way of doing this, specially for large lists. On another note, is there a function that tells me how many items there are in a list, something like: x = count(list1). Thanks in advance. |
Support DC |
Posted: Jan 15 2008, 02:41 PM
|
![]() |
I would create the list and use the isunique condition to assure that each item in the list is unique. For example:
a1 range(2,60) a2 range(2,60) a3 range(2,60) a4 range(2,60) a5 range(2,60) a6 range(2,60) a7 range(2,60) a8 range(2,60) condition isunique(a1,a2,a3,a4,a5,a6,a7,a8) alist list(a1,a2,a3,a4,a5,a6,a7,a8) You can then choose as many items from that list as you wish. |
![]() ![]() ![]() |