|
Jah Wanderer
Joined: 11 Oct 2000 Posts: 52 Location: Sweden
|
Posted: Thu Jul 03, 2003 5:37 am
%sort |
Can %sort sort more then just initial number?
|
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Thu Jul 03, 2003 3:45 pm |
%sort can sort the members of a list. It doesn't seem to have any limit on the size of the list, but everything being sorted would have to be in the same list.
I hope that answers your question, since I couldn't understand what you're asking. I don't see any reference to "initial number" in the explanation of %sort. |
|
|
|
Jah Wanderer
Joined: 11 Oct 2000 Posts: 52 Location: Sweden
|
Posted: Thu Jul 03, 2003 4:35 pm |
Hmm a list can only sort the first number. A sorted list will be like
5|2000|121
I want it to sort it like
2000|121|5 |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Thu Jul 03, 2003 8:55 pm |
Oh, you want to sort numbers. No, %sort can't sort by numerical value. It's based on alphabetical order, and alphabetical order is determined by the initial character (actually by the first non-identical character of two items). You'll have to create your own routine to sort by numerical value.
|
|
|
|
Jah Wanderer
Joined: 11 Oct 2000 Posts: 52 Location: Sweden
|
Posted: Thu Jul 03, 2003 10:01 pm |
Ok so im screwed then. :)
|
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Fri Jul 04, 2003 5:09 am |
No, just because there's not a built-in function doesn't mean it's impossible. It just means you'll have to be more creative.
For instance, you could use two lists and then take the highest value from the first list using %max, add it to the second list using #ADDITEM or %additem, and then delete it from the first list using #DELITEM or %delitem (use #ADDI/#DELI if duplicate values aren't desired, %additem/%delitem if they are). Repeat until all values are removed from the first list, at which point your sorted values will be in the second list. |
|
|
|
Jah Wanderer
Joined: 11 Oct 2000 Posts: 52 Location: Sweden
|
Posted: Fri Jul 04, 2003 3:04 pm |
Man. Thats genious. Thank you :)
|
|
|
|
PathetiC Newbie
Joined: 10 Sep 2001 Posts: 6 Location: Sweden
|
Posted: Fri Dec 05, 2003 2:59 pm |
quote: Originally posted by LightBulb
No, just because there's not a built-in function doesn't mean it's impossible. It just means you'll have to be more creative.
For instance, you could use two lists and then take the highest value from the first list using %max, add it to the second list using #ADDITEM or %additem, and then delete it from the first list using #DELITEM or %delitem (use #ADDI/#DELI if duplicate values aren't desired, %additem/%delitem if they are). Repeat until all values are removed from the first list, at which point your sorted values will be in the second list.
I wasn't the one starting this topic.. But I was having major troubles with the same issue.. Tried to make an average damage counter.. To show who in group did the most damage.. Thanks for tipping me off on the %max() command.. |
|
|
|
|
|