Subversion Repositories wimsdev

Rev

Rev 4158 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
20 reyssat 1
!if $wims_read_parm!=slib_header
2
 !goto proc
3
!endif
4158 bpr 4
 
4349 bpr 5
slib_author=Gang, XIAO
4158 bpr 6
 
20 reyssat 7
!exit
8
 
9
:proc
10
slib_ltest=!linecnt $wims_read_parm
11
!if $slib_ltest>1
12
 slib_inp=!lines2rows $wims_read_parm
13
 slib_type=lines
14
!else
15
 slib_inp=$wims_read_parm
16
 slib_type=rows
17
!endif
18
slib_n=!item 1 of $slib_inp
19
slib_option=!item 2 of $slib_inp
20
slib_data=!item 3 to -1 of $slib_inp
21
slib_r1=!row 1 of $slib_data
22
slib_N=!itemcnt $slib_r1
23
!bound $slib_n between integer 1 and $slib_N default 1
24
slib_key=!column $slib_n of $slib_data
25
slib_tt=0
26
!if reverse iswordof $slib_option
27
 slib_tt=$[$slib_tt+1]
28
!endif
29
!if numeric iswordof $slib_option
30
 slib_tt=$[$slib_tt+2]
31
!endif
32
!if nocase iswordof $slib_option
33
 slib_tt=$[$slib_tt+4]
34
!endif
35
 
36
!goto sort$slib_tt
37
 
38
:sort0
39
 slib_out=!sort items $slib_key
40
 !goto send
41
:sort1
42
 slib_out=!sort reverse items $slib_key
43
 !goto send
44
:sort2
45
 slib_out=!sort numeric items $slib_key
46
 !goto send
47
:sort3
48
 slib_out=!sort reverse numeric items $slib_key
49
 !goto send
50
:sort4
51
 slib_out=!sort nocase items $slib_key
52
 !goto send
53
:sort5
54
 slib_out=!sort reverse nocase items $slib_key
55
 !goto send
56
:sort6
57
 slib_out=!sort numeric nocase items $slib_key
58
 !goto send
59
:sort7
60
 slib_out=!sort numeric nocase reverse items $slib_key
61
 
62
:send
63
slib_out=!row $wims_sort_order of $slib_data
64
!if $slib_type=lines
65
 slib_out=!rows2lines $slib_out
66
!endif