Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ARRAY member functions
#9
It would be nice to have other ARRAY functions.

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

Macro Remove duplicates
Code:
Copy      Help
ARRAY a.create(7)

a[0]= 1
a[1]= 1
a[2]= 2
a[3]= 3
a[4]= 3
a[5]= 6
a[6]= 6


a.unique

int i

out
for i 0 a.len
,out a[i]


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)