~vcs-imports/gawk/master

183 by Arnold D. Robbins
User function sorting added, documented, tested.
1
--- number before string, ascending by index ---
2
1         10
3
2         200
4
100       1
5
bat       tab
6
cat       tac
7
rat       tar
8
--- deterministic, by value (index), descending numeric ---
9
2         200
10
20        10
11
14        10
12
11        10
13
100       5
14
4         1
15
--- asort(a, b, "comp_val_num"), IGNORECASE = 0---
277.1.13 by Arnold D. Robbins
Fix sortu test.
16
[1]       :barz      Zebra     
17
[2]       :blattt    barz      
18
[3]       :Zebra     blattt    
183 by Arnold D. Robbins
User function sorting added, documented, tested.
19
[4]       :1234      234       
20
[5]       :234       1234      
21
--- asort(a, b, "comp_val_str"), IGNORECASE = 0---
22
[1]       :barz      1234      
23
[2]       :blattt    234       
24
[3]       :Zebra     Zebra     
25
[4]       :1234      barz      
26
[5]       :234       blattt    
27
--- asort(a, a, "comp_val_str"), IGNORECASE = 0---
28
[1]       :1234      
29
[2]       :234       
30
[3]       :Zebra     
31
[4]       :barz      
32
[5]       :blattt    
33
--- asort(a, b, "comp_val_num"), IGNORECASE = 1---
34
[1]       :barz      barz      
35
[2]       :blattt    blattt    
36
[3]       :Zebra     Zebra     
37
[4]       :1234      234       
38
[5]       :234       1234      
39
--- asort(a, b, "comp_val_str"), IGNORECASE = 1---
40
[1]       :barz      1234      
41
[2]       :blattt    234       
42
[3]       :Zebra     barz      
43
[4]       :1234      blattt    
44
[5]       :234       Zebra     
45
--- asort(a, a, "comp_val_str"), IGNORECASE = 1---
46
[1]       :1234      
47
[2]       :234       
48
[3]       :barz      
49
[4]       :blattt    
50
[5]       :Zebra