arrays

M

Mike P

I have a collection of objects that may have duplicates in it. What I
want to do is to iterate through the list and only add the non
duplicates to an array, so as I am adding to the array, I need some way
of checking against the current contents of the array. Is this
possible, or is there a better way to do this?
 
B

Bob Barrows [MVP]

Mike said:
I have a collection of objects that may have duplicates in it. What I
want to do is to iterate through the list and only add the non
duplicates to an array, so as I am adding to the array, I need some
way of checking against the current contents of the array. Is this
possible, or is there a better way to do this?
There's no shortcut. You need to do a nested loop.


start loop through collection
within the collection loop, loop through the array checking to see if object
already exists.
if not, add the object to the array and move to the next object

Do you need more detail than that? if so, we sill need more details.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top