Subversion Repositories wimsdev

Rev

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

Rev 13585 Rev 13902
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
!!Rajout option tex par Gilles Marbeuf avril 2019
6
slib_example=4345678\
7
slib_example=4345678\
-
 
8
4345678,tex\
7
5678\
9
5678\
-
 
10
5678,tex\
8
5 234\
11
5 234\
-
 
12
5 234,tex\
9
456.789567\
13
456.789567\
-
 
14
456.789567,tex\
10
456.789567,comma\
15
456.789567,comma\
-
 
16
456.789567,comma tex\
11
[897456,789],comma
17
[897456,789],comma\
-
 
18
[897456,789],comma tex
12
!exit
19
!exit
13
 
20
 
14
:proc
21
:proc
15
slib_input=$(wims_read_parm[1])
22
slib_input=$(wims_read_parm[1])
16
slib_input=!declosing $slib_input
23
slib_input=!declosing $slib_input
17
slib_input=!replace internal , by . in $slib_input
24
slib_input=!replace internal , by . in $slib_input
18
!if comma isin $wims_read_parm
25
!if comma isin $wims_read_parm
19
 slib_point=,
26
  slib_point=,
20
!endif
27
!endif
21
!default slib_point=.
28
!default slib_point=.
-
 
29
 
-
 
30
!if tex isin $wims_read_parm
-
 
31
  slib_sep=\:
-
 
32
!else
-
 
33
  slib_sep=$ $
-
 
34
!endif
22
 
35
 
23
slib_test=$[$slib_input]
36
slib_test=$[$slib_input]
24
!if NaN isin $slib_test
37
!if NaN isin $slib_test
25
  slib_out=NaN
38
  slib_out=NaN
26
  !exit
39
  !exit
27
!endif
40
!endif
28
 
41
 
29
!if e isin $slib_input
42
!if e isin $slib_input
30
  slib_out=$slib_input
43
  slib_out=$slib_input
31
  !exit
44
  !exit
32
!endif
45
!endif
33
slib_input=!nospace $slib_input
46
slib_input=!nospace $slib_input
34
slib_decomp=!replace internal . by , in $slib_input
47
slib_decomp=!replace internal . by , in $slib_input
35
slib_part=!item 1 of $slib_decomp
48
slib_part=!item 1 of $slib_decomp
36
slib_nbchi=!charcnt $slib_part
49
slib_nbchi=!charcnt $slib_part
37
slib_nbgrp=$[floor($slib_nbchi/3)]
50
slib_nbgrp=$[floor($slib_nbchi/3)]
38
slib_out=$empty
51
slib_out=$empty
39
!ifval $slib_nbgrp*3!=$slib_nbchi
52
!ifval $slib_nbgrp*3!=$slib_nbchi
40
  slib_out=!char 1 to $[$slib_nbchi-3*$slib_nbgrp] of $slib_part
53
  slib_out=!char 1 to $[$slib_nbchi-3*$slib_nbgrp] of $slib_part
41
!endif
54
!endif
42
!for slib_i=0 to $slib_nbgrp-1
55
!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
56
  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
57
  slib_out=$slib_out$slib_sep$slib_tmp
45
!next slib_i
58
!next slib_i
46
 
59
 
47
slib_tst=!itemcnt $slib_decomp
60
slib_tst=!itemcnt $slib_decomp
48
!if $slib_tst=1
61
!if $slib_tst=1
49
  slib_out=!singlespace $slib_out
62
  slib_out=!singlespace $slib_out
Line 54... Line 67...
54
slib_nbgrp=$[ceil($slib_nbchi/3)]
67
slib_nbgrp=$[ceil($slib_nbchi/3)]
55
slib_tmp=!char 1 to 3 of $slib_part
68
slib_tmp=!char 1 to 3 of $slib_part
56
slib_out=$(slib_out)$slib_point$slib_tmp
69
slib_out=$(slib_out)$slib_point$slib_tmp
57
!for slib_i=1 to $slib_nbgrp
70
!for slib_i=1 to $slib_nbgrp
58
  slib_tmp=!char $[1+3*($slib_i)] to $[3+3*$slib_i] of $slib_part
71
  slib_tmp=!char $[1+3*($slib_i)] to $[3+3*$slib_i] of $slib_part
59
  slib_out=$slib_out $slib_tmp
72
  slib_out=$slib_out$slib_sep$slib_tmp
60
!next slib_i
73
!next slib_i
61
 
74
 
62
slib_out=!singlespace $slib_out
75
slib_out=!singlespace $slib_out
-
 
76
 
-
 
77
!reset slib_input slib_point slib_decomp slib_sep slib_test slib_part slib_nbchi slib_nbgrp slib_tmp