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.
on sortByValue inputList, outputList
valueList = []
outList = [:]
repeat with temp in inputList
add valueList, temp
end repeat
sort valueList
repeat with temp in valueList
prop = getOne(folderList, temp)
addProp outputList, prop, temp
end repeat
put "outputList = " && outputList
outputList = outList
end
It appears to work but I don't know what to do if there are 2 properties
with the same value with my method. Just wonder if there is a better and
quicker way to do this?
Also, how do I make whatever I type as "outputList" to become a global so
it can recognized by others?
for example:
if I use sorByValue (folderList), (newFolderList), then there would be
global variable named newFolderList generated and the rightly sorted list
would be in newFolderList.
Thanks for the help,
Changhsu Liu
[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!]