Sort function + extra features

Post your working scripts, libraries and tools
User avatar
jeeswg
Posts: 4504
Joined: 19 Dec 2016, 01:58
Location: UK

Sort function + extra features

10 Jun 2018, 17:01

- I was wanting to create a variant of the Sort function.
- To support various features:
- bound functions
- linear arrays
- null sort (what I've called the 'null sort', the equivalent of a 3-parameter comparison function that returns -offset)
- remove duplicates: all/adjacent
- remove duplicates without sorting the list
- reverse a list without sorting it
- sort by string length
- sort by the nth column
- sort case insensitive 'upper' (as though strings were converted to upper case before comparison) (the default is to convert to lower case prior to comparison)
- sort individual characters (no delimiter character) (e.g. alphabetise/randomise/reverse strings)
- sort reverse order special (swap if different, else maintain order)
- stable sort

- I mentioned some Sort command queries here:
Sort: Z mode and CRLF handling - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=5&t=50364

- Here are some examples, and a prototype function (and an auxiliary 'filter' function):
- Note: the two functions haven't been tested extensively.

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus

Return to “Scripts and Functions”

Who is online

Users browsing this forum: arcticir and 15 guests