There is bug in this extension, as mentioned here
Please use the new buildin 'sort list' block instead.
This is a simple extension, and now only have one block to sort a list:
cn.kevinkun.listutil.aix (8.8 KB)
How to use
- make a procedure with 2 parameters, and return a number (integer or float both ok)
sort a list of number
sort a list of list according to 2nd item (a number) of sublist
3, sort a list of list according to 1st item (a string) of sublist
- sort a list of list according to lenth of 1st item
if a decending list wanted, just change symbol of procedure's return value.
- "call function" is from @ewpatton;
- Extension build with Rush
Great!.. Such a wounderful extension. No need of multiple blocks to sort the list in desired mode.. You made it in very simple mannar..
Do you have a link to the source?
This is an important piece of code.
A couple more examples:
Sort List of Strings:
is there a way to exclude the list items that do not match ?
Maybe I should add filer and map function later.
I don't understand what are x and x2 in procedure and how it works...
you can give them any name you want. they represent two items from the list.
ok. and then result 1 means increase order and -1 decrease order...
i think it's ok. thanks
10 posts were split to a new topic: How to sort a list of lists by date?