I'm struggeling with an array containing several times the same values.
MyArray = #(1,2,3,1,2,3,1,2,3)
Does anyone know how to filter the redondant values in order to get:
MyArray = #(1,2,3)
Forum topic · General Scripting
By Ewok · 2012-04-10
I'm struggeling with an array containing several times the same values.
MyArray = #(1,2,3,1,2,3,1,2,3)
Does anyone know how to filter the redondant values in order to get:
MyArray = #(1,2,3)
makeUniqueArray
jos · 2012-04-10
You can simply use
makeUniqueArray MyArray
--returns #(1, 2, 3)Cool!!!Thanks a lot.I had
Ewok · 2012-04-11
Cool!!!
Thanks a lot.
I had figured out this workaround:
List = #(1,2,3,4,1,2)
List02 = #()
PreviousValue = #()
sort List
for element in List do
(if element != PreviousValue then append List02 element
PreviousValue = element)
List = List02But nothing's shorter than 'makeUniqueArray'
Thank you very much.
Ewok