Hi, I'm taking the opportunity to say "Hi, I'm a new one at this list." :)
I'd create a new list with the values of the combine properties and sort that one and in the same time making the same changes to the original list. My code: on sortList iList -- Creating the list to sort -- tList = [] repeat with tData in iList -- This is similar to the 'Prop1 + Prop2 + Prop3' you used. -- tValue = tData[#Prop1] & tData[#Prop2] & tData[#Prop3] tList.append(tValue) end repeat -- Tha actual sorting -- tCount = iList.count repeat with i = 1 to tCount - 1 j = tCount repeat while j > i -- Checking the list you just created -- if tList[j-1]>tList[j] then -- Making the change in the list you crated -- tData = tList[j-1] tList[j-1] = tList[j] tList[j] = tData -- Making the change in the original list -- tData = iList[j-1] iList[j-1] = iList[j] iList[j] = tData end if j=j-1 end repeat end repeat return iList end on test tt = [ [#Prop1: "abc", #Prop2: "02", #Prop3: "02"], [#Prop1: "abc", #Prop2: "02", #Prop3: "01"], [#Prop1: "xyz", #Prop2: "02", #Prop3: "01"], [#Prop1: "abc", #Prop2: "01", #Prop3: "01"]] put sortList(tt) end -- [[#Prop1: "abc", #Prop2: "01", #Prop3: "01"], [#Prop1: "abc", #Prop2: "02", #Prop3: "01"], [#Prop1: "abc", #Prop2: "02", #Prop3: "02"], [#Prop1: "xyz", #Prop2: "02", #Prop3: "01"]] Hope this help. /Per-Erik Bergman http://www.uncle.nu/ -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Slava Paperno Sent: den 31 maj 2004 18:36 To: [EMAIL PROTECTED] Subject: <lingo-l> Sorting Challenge Is there an xplat Xtra that expands Directors limited ability to sort lists? Or, can someone please advise me on how to implement this sort? I have a linear list where the value of each item is a property list, [ [#Prop1: "abc", #Prop2: "02", #Prop3: "02"], [#Prop1: "abc", #Prop2: "02", #Prop3: "01"], [#Prop1: "xyz", #Prop2: "02", #Prop3: "01"], [#Prop1: "abc", #Prop2: "01", #Prop3: "01"], ] I need to sort the outer linear list on the compound values of the three properties in the inner lists, so I get this: [ [#Prop1: "abc", #Prop2: "01", #Prop3: "01"], [#Prop1: "abc", #Prop2: "02", #Prop3: "01"], [#Prop1: "abc", #Prop2: "02", #Prop3: "02"], [#Prop1: "xyz", #Prop2: "02", #Prop3: "01"] ] If this were a database table with three fields and four records, I'd use a compound index, Prop1 + Prop2 + Prop3. How can I achieve the same result in Director MX? The size of my lists and the number of properties in each list are quite modest, so peformance is not really an important factor. Any advice will be appreciated. Slava [To remove yourself from this list, or to change to digest mode, go to http://www.penworks.com/lingo-l.cgi To post messages to the list, email [EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED]). Lingo-L is for learning and helping with programming Lingo. Thanks!] [To remove yourself from this list, or to change to digest mode, go to http://www.penworks.com/lingo-l.cgi To post messages to the list, email [EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED]). Lingo-L is for learning and helping with programming Lingo. Thanks!]