Subversion Repositories wimsdev

Rev

Rev 4158 | Rev 7692 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4158 Rev 4701
Line 4... Line 4...
4
 
4
 
5
slib_author=Fabrice Guerimand 
5
slib_author=Fabrice, Guerimand
-
 
6
slib_example=4345678\
6
 
7
5678\
-
 
8
5 234\
-
 
9
456.789567\
-
 
10
456.789567,comma\
-
 
11
[897456,789],comma
7
!exit
12
!exit
8
 
13
 
9
:proc
14
:proc
10
slib_input=$wims_read_parm
15
slib_input=$(wims_read_parm[1])
-
 
16
slib_input=!declosing $slib_input
-
 
17
slib_input=!replace internal , by . in $slib_input
-
 
18
!if comma isin $wims_read_parm
-
 
19
 slib_point=,
-
 
20
!endif
-
 
21
!default slib_point=.
11
 
22
 
12
test=$[$slib_input]
23
slib_test=$[$slib_input]
13
!if NaN isin $test
24
!if NaN isin $slib_test
14
 slib_out=NaN
25
 slib_out=NaN
15
 !exit
26
 !exit
16
!endif
27
!endif
17
 
28
 
18
!if e isin $slib_input
29
!if e isin $slib_input
19
 slib_out=$slib_input
30
 slib_out=$slib_input
20
 !exit
31
 !exit
21
!endif
32
!endif
22
 
-
 
-
 
33
slib_input=!nospace $slib_input
23
decomp=!replace internal . by , in $slib_input
34
slib_decomp=!replace internal . by , in $slib_input
24
part=!item 1 of $decomp
35
slib_part=!item 1 of $slib_decomp
25
nbchi=!charcnt $part
36
slib_nbchi=!charcnt $slib_part
26
nbgrp=$[floor($nbchi/3)]
37
slib_nbgrp=$[floor($slib_nbchi/3)]
27
slib_out=$empty
38
slib_out=$empty
28
!ifval $nbgrp*3!=$nbchi
39
!ifval $slib_nbgrp*3!=$slib_nbchi
29
 slib_out=!char 1 to $[$nbchi-3*$nbgrp] of $part
40
 slib_out=!char 1 to $[$slib_nbchi-3*$slib_nbgrp] of $slib_part
30
!endif
41
!endif
31
!for i=0 to $nbgrp-1 
42
!for slib_i=0 to $slib_nbgrp-1 
32
 tmp=!char $[$nbchi-3*($nbgrp-$i)+1] to $[$nbchi-3*($nbgrp-$i-1)] of $part
43
 slib_tmp=!char $[$slib_nbchi-3*($slib_nbgrp-$slib_i)+1] to $[$slib_nbchi-3*($slib_nbgrp-$slib_i-1)] of $slib_part
33
 slib_out=$slib_out $tmp
44
 slib_out=$slib_out $slib_tmp
34
!next i
45
!next slib_i
35
 
46
 
36
tst=!itemcnt $decomp
47
slib_tst=!itemcnt $slib_decomp
37
!if $tst=1
48
!if $slib_tst=1
-
 
49
 slib_out=!singlespace $slib_out
38
 !exit
50
 !exit
39
!endif
51
!endif
40
part=!item 2 of $decomp
52
slib_part=!item 2 of $slib_decomp
41
nbchi=!charcnt $part
53
slib_nbchi=!charcnt $slib_part
42
nbgrp=$[ceil($nbchi/3)]
54
slib_nbgrp=$[ceil($slib_nbchi/3)]
43
tmp=!char 1 to 3 of $part
55
slib_tmp=!char 1 to 3 of $slib_part
44
slib_out=$(slib_out).$tmp
56
slib_out=$(slib_out)$slib_point$slib_tmp
45
!for i=1 to $nbgrp 
57
!for slib_i=1 to $slib_nbgrp 
46
 tmp=!char $[1+3*($i)] to $[3+3*$i] of $part
58
 slib_tmp=!char $[1+3*($slib_i)] to $[3+3*$slib_i] of $slib_part
47
 slib_out=$slib_out $tmp 
59
 slib_out=$slib_out $slib_tmp 
48
!next i
60
!next slib_i
-
 
61
 
-
 
62
slib_out=!singlespace $slib_out