If this looks like the sorting result you want...
-- Welcome to Director --
foo = [#a: 12, #b: 5, #c: 12, #b: 4, #d: 2]
put uPropListSortByValue(foo)
-- [#d: 2, #b: 4, #b: 5, #a: 12, #c: 12]
...then this handler will do it...
on uPropListSortByVal aList
tOutList = [:]
tTempList = [:]
tLim = aList.count
repeat with i = 1 to tLim
tTempList.addProp(aList[i], aList.getPropAt(i))
end repeat
tTempList.sort()
repeat with i = 1 to tLim
tOutList.addProp(tTempList[i], tTempList.getPropAt(i))
end repeat
return tOutList
end
Of course you'll need to add validation that the input parameter is indeed a property
list, etc. And I have not done any speed testing on this. There may be a more
efficient approach.
-Jeff
>I have a property lis like the one below:
>aList = [a:88, b:22, c:34]
>Sort only sorts the property name not the value it has. I have the
>following handler to create another list that extract the value and
>sort the new list and then combine the 2 together in a new list that
>is sorted based on the value.
>
[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/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!]