[Gambas-user] To the wish list...
Jussi Lahtinen
jussi.lahtinen at ...626...
Fri Aug 21 21:43:23 CEST 2009
Now I use algorithm like this (maybe not optimal);
Dim ii As Integer
Dim jj As Integer
Dim bRemove As Boolean
While ii < iMyArray.Count
jj = 0
bRemove = False
While jj < iMyArray.Count
If ii <> jj And iMyArray[ii] = iMyArray[jj] Then
iMyArray.Remove(ii)
bRemove = True
Else
Inc jj
Endif
Wend
If bRemove = False Then
Inc ii
Endif
Wend
Good point Benôit. Array is populated from file, but maybe I should use .Find()
before .Add().
Jussi
2009/8/21 Benoît Minisini <gambas at ...1...>:
>> Hi!
>> Gambas has VERY good set of methods regarding arrays, but something is
>> missing! I'd like to see iMyArray.RemoveDuplicates. Because with large
>> arrays this simple task
>> is pretty CPU intensive!
>> What do you think?
>>
>>
>> Jussi
>>
>
> Why do you have duplicates inside your array?
>
> --
> Benoît
>
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
> trial. Simplify your report design, integration and deployment - and focus on
> what you do best, core application coding. Discover what's new with
> Crystal Reports now. http://p.sf.net/sfu/bobj-july
> _______________________________________________
> 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