[Gambas-user] Make an array having only unique entries

Stephen Bungay sbungay at ...981...
Sat Mar 22 00:14:39 CET 2008


   Push the array (or result, or whatever) to a collection and use the 
category as the index into it. If you try to add an index twice it will 
throw an error, at which time you keep on processing, proceeding to the 
next item. Now you have a unique collection of items, you don't need to 
use an array, but if you want to just push the collection back to the 
array. Two step process, no fuss, no muss.

Ron wrote:
> Hi,
> 
> a simple basic question, but i'm so good with arrays ;-)
> 
> Say I have a array with categories in them, also alot of double ones, 
> how can I weed out the double entries easy?
> 
> Thanks in advance!
> 
> Regards,
> Ron.
> 
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
> 





More information about the User mailing list