PDA

View Full Version : set - unordered


bandito
January 22nd, 2008, 10:10 PM
Hi,

I was working with Set tonight when I noticed that adding elements does not hold elements in the same order as they were added. Verified also by the documentation, I am a bit lost as to what to do. I need Set to keep a collection of elements that are unique but I also need a reference to the first element that is added which makes an array or hash ideal.

Any ideas?

Thanks

Carl

http://www.gaihosa.com

bandito
January 23rd, 2008, 06:51 PM
Never mind, I figured it out. Just have to do a Set intersection which returns a new array with no duplicate elements. Basically I did as follows:


Cheers,

Carl

http://www.gaihosa.com