Rev 3265 | Rev 4701 | 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 |
||
4 | |||
5 | slib_author=Fabrice Guerimand |
||
4158 | bpr | 6 | |
20 | reyssat | 7 | !exit |
8 | |||
9 | :proc |
||
10 | slib_input=$wims_read_parm |
||
11 | |||
12 | test=$[$slib_input] |
||
13 | !if NaN isin $test |
||
14 | slib_out=NaN |
||
15 | !exit |
||
16 | !endif |
||
17 | |||
18 | !if e isin $slib_input |
||
19 | slib_out=$slib_input |
||
20 | !exit |
||
21 | !endif |
||
22 | |||
23 | decomp=!replace internal . by , in $slib_input |
||
24 | part=!item 1 of $decomp |
||
25 | nbchi=!charcnt $part |
||
26 | nbgrp=$[floor($nbchi/3)] |
||
27 | slib_out=$empty |
||
28 | !ifval $nbgrp*3!=$nbchi |
||
29 | slib_out=!char 1 to $[$nbchi-3*$nbgrp] of $part |
||
30 | !endif |
||
31 | !for i=0 to $nbgrp-1 |
||
32 | tmp=!char $[$nbchi-3*($nbgrp-$i)+1] to $[$nbchi-3*($nbgrp-$i-1)] of $part |
||
33 | slib_out=$slib_out $tmp |
||
34 | !next i |
||
35 | |||
36 | tst=!itemcnt $decomp |
||
37 | !if $tst=1 |
||
38 | !exit |
||
39 | !endif |
||
40 | part=!item 2 of $decomp |
||
41 | nbchi=!charcnt $part |
||
42 | nbgrp=$[ceil($nbchi/3)] |
||
43 | tmp=!char 1 to 3 of $part |
||
44 | slib_out=$(slib_out).$tmp |
||
45 | !for i=1 to $nbgrp |
||
46 | tmp=!char $[1+3*($i)] to $[3+3*$i] of $part |
||
47 | slib_out=$slib_out $tmp |
||
48 | !next i |