[FREE]Extension for Sort List with comparator

This is a simple extension, and now only have one block to sort a list:

Download link:

cn.kevinkun.listutil.aix (8.8 KB)

How to use

  1. make a procedure with 2 parameters, and return a number (integer or float both ok)

Example:

  1. sort a list of number
    2022-05-13_103049

  2. sort a list of list according to 2nd item (a number) of sublist
    2022-05-13_103110

3, sort a list of list according to 1st item (a string) of sublist
2022-05-13_103119

  1. sort a list of list according to lenth of 1st item
    2022-05-13_103059

if a decending list wanted, just change symbol of procedure's return value.

Credit

  1. "call function" is from @ewpatton;
  2. Extension build with Rush
10 Likes

Great!.. Such a wounderful extension. No need of multiple blocks to sort the list in desired mode.. You made it in very simple mannar..
:heart:

2 Likes

shuffle a list:
2022-05-13_134038

1 Like

Do you have a link to the source?
This is an important piece of code.

Here :

5 Likes

A couple more examples:

Sort List of Strings:

image

image

"Filter" by contains:

image

image

is there a way to exclude the list items that do not match ?

Maybe I should add filer and map function later.