$min add'l sort orders - 27/09/20 05:05 PM
Suggestion to have an additional .prop's for $min and $max which use the default $sorttok and $sorttokcs orders when they don't use the $3 switch. The current mappings for $min appear to be:
no .prop = $sorttok 'n' numeric
.text = $sorttok 'a' alphanumeric
.textcs = $sortokcs 'a' alphanumeric
.nick = $sorttok 'c' channel
missing = $sorttok no-switch
missing = $sorttokcs no-switch
Quote
no .prop = $sorttok 'n' numeric
.text = $sorttok 'a' alphanumeric
.textcs = $sortokcs 'a' alphanumeric
.nick = $sorttok 'c' channel
missing = $sorttok no-switch
missing = $sorttokcs no-switch
Code
alias minmaxsort { if ($1- == $null) var -s %list a 0 b \ 1 ! A . ~ 2 @ 11 | else var %list $1- echo -a default : $sorttok( %list,32) echo -a alphanum: $sorttok( %list,32,a) min: $min(%list).text max: $max(%list).text echo -a numeric : $sorttok( %list,32,n) min: $min(%list) max: $max(%list) echo -a nicklist: $sorttok( %list,32,c) min: $min(%list).nick max: $max(%list).nick echo -a alnum cs: $sorttokcs(%list,32,a) min: $min(%list).textcs max: $max(%list).textcs var -s %list a 0 b \ 1 A ~ 2 11 echo -a default :: $sorttok( %list,32) echo -a defaultcs: $sorttokcs( %list,32) echo -a alpha num: $sorttok( %list,32,a) min: $min(%list).text max: $max(%list).text echo -a alnum cs : $sorttokcs( %list,32,a) min: $min(%list).textcs max: $max(%list).textcs var -s %list a \ A echo -a default : $sorttok( %list,32) echo -a defaultcs: $sorttokcs( %list,32) }