Subversion Repositories wimsdev

Rev

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

Rev 7692 Rev 13585
Line 1... Line 1...
1
!if $wims_read_parm!=slib_header
1
!if $wims_read_parm!=slib_header
2
 !goto proc
2
  !goto proc
3
!endif
3
!endif
4
 
4
 
5
slib_author=Fabrice, Guerimand
5
slib_author=Fabrice, Guerimand
6
slib_example=4345678\
6
slib_example=4345678\
7
5678\
7
5678\
Line 20... Line 20...
20
!endif
20
!endif
21
!default slib_point=.
21
!default slib_point=.
22
 
22
 
23
slib_test=$[$slib_input]
23
slib_test=$[$slib_input]
24
!if NaN isin $slib_test
24
!if NaN isin $slib_test
25
 slib_out=NaN
25
  slib_out=NaN
26
 !exit
26
  !exit
27
!endif
27
!endif
28
 
28
 
29
!if e isin $slib_input
29
!if e isin $slib_input
30
 slib_out=$slib_input
30
  slib_out=$slib_input
31
 !exit
31
  !exit
32
!endif
32
!endif
33
slib_input=!nospace $slib_input
33
slib_input=!nospace $slib_input
34
slib_decomp=!replace internal . by , in $slib_input
34
slib_decomp=!replace internal . by , in $slib_input
35
slib_part=!item 1 of $slib_decomp
35
slib_part=!item 1 of $slib_decomp
36
slib_nbchi=!charcnt $slib_part
36
slib_nbchi=!charcnt $slib_part
37
slib_nbgrp=$[floor($slib_nbchi/3)]
37
slib_nbgrp=$[floor($slib_nbchi/3)]
38
slib_out=$empty
38
slib_out=$empty
39
!ifval $slib_nbgrp*3!=$slib_nbchi
39
!ifval $slib_nbgrp*3!=$slib_nbchi
40
 slib_out=!char 1 to $[$slib_nbchi-3*$slib_nbgrp] of $slib_part
40
  slib_out=!char 1 to $[$slib_nbchi-3*$slib_nbgrp] of $slib_part
41
!endif
41
!endif
42
!for slib_i=0 to $slib_nbgrp-1
42
!for slib_i=0 to $slib_nbgrp-1
43
 slib_tmp=!char $[$slib_nbchi-3*($slib_nbgrp-$slib_i)+1] to $[$slib_nbchi-3*($slib_nbgrp-$slib_i-1)] of $slib_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
44
 slib_out=$slib_out $slib_tmp
44
  slib_out=$slib_out $slib_tmp
45
!next slib_i
45
!next slib_i
46
 
46
 
47
slib_tst=!itemcnt $slib_decomp
47
slib_tst=!itemcnt $slib_decomp
48
!if $slib_tst=1
48
!if $slib_tst=1
49
 slib_out=!singlespace $slib_out
49
  slib_out=!singlespace $slib_out
50
 !exit
50
  !exit
51
!endif
51
!endif
52
slib_part=!item 2 of $slib_decomp
52
slib_part=!item 2 of $slib_decomp
53
slib_nbchi=!charcnt $slib_part
53
slib_nbchi=!charcnt $slib_part
54
slib_nbgrp=$[ceil($slib_nbchi/3)]
54
slib_nbgrp=$[ceil($slib_nbchi/3)]
55
slib_tmp=!char 1 to 3 of $slib_part
55
slib_tmp=!char 1 to 3 of $slib_part
56
slib_out=$(slib_out)$slib_point$slib_tmp
56
slib_out=$(slib_out)$slib_point$slib_tmp
57
!for slib_i=1 to $slib_nbgrp
57
!for slib_i=1 to $slib_nbgrp
58
 slib_tmp=!char $[1+3*($slib_i)] to $[3+3*$slib_i] of $slib_part
58
  slib_tmp=!char $[1+3*($slib_i)] to $[3+3*$slib_i] of $slib_part
59
 slib_out=$slib_out $slib_tmp
59
  slib_out=$slib_out $slib_tmp
60
!next slib_i
60
!next slib_i
61
 
61
 
62
slib_out=!singlespace $slib_out
62
slib_out=!singlespace $slib_out