Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ARRAY.unique
#1
Dear Gintaras and QMers:

Is there any chance to implement array.unique in order to remove duplicate elements?

It would be very useful.

Some kind of...
Member function ARRAY.unique
Code:
Copy      Help
function

int i j

for i this.len-1 0 -1
,for(j 0 i) if this[j]=this[i]; this.remove(i); break
#2
In QM you cannot add user-defined member functions of ARRAY. Then would need separate functions for ARRAY(int), ARRAY(str) etc. Use non-member functions instead.

Function ARRAY_int_Unique
function ARRAY(int)&a
...
for i a.len-1 0 -1
...
#3
Thanks.

Is there any chance to implement array.unique in a new QM release? For sure, it would be useful and faster.
#4
No. Difficult to compare all types.


Forum Jump:


Users browsing this thread: 1 Guest(s)