|
From: Arielle on 5 May 2008 07:47 Hello: I need to join some lists in only one. I do the following: list1=["A","B"] list2=["C","D"] list3=["E","F"] list123=list1&list2&list3 put list123 -- "["A", "B"]["C", "D"]["E", "F"]" I need this: list123=["A","B","C","D","E","F"] Can you help me please? thank you very much
From: Dave C on 5 May 2008 08:04 Maybe there is a more direct way, but it is easy enough to make a custom handler. -------------------------------- on concatentateLists listofLists returnList = [] repeat with j in listofLists repeat with k in j returnList.add(k) end repeat end repeat return returnList end --------------------------------- Testing results -- Welcome to Director -- list1=["A","B"] list2=["C","D"] list3=["E","F"] put concatentateLists([list1,list2,list3]) -- ["A", "B", "C", "D", "E", "F"]
From: Dave C on 5 May 2008 08:07 You can even make the handler name spell the word concatenate correctly if you so desire. ;-)
From: Chunick on 6 May 2008 00:32 and it's quicker to use .append() instead of .add() ... fractions of a millisecond, but it can add up ;-)
|
Pages: 1 Prev: Problem in minimizing the MIAW Next: About UpdateStage.com |