Rev 12555 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
7290 | bpr | 1 | !! |
5204 | guerimand | 2 | !! update a field of an exo of a sheet |
3 | !! |
||
4 | !! needed information : |
||
5 | !! sheet : num of modify sheet |
||
6 | !! exo : num of exo modifiy in the sheet |
||
7290 | bpr | 7 | !! update_field : is the number of the field to be modified. |
5204 | guerimand | 8 | !! update_content : new content of the line |
15763 | guerimand | 9 | number_field=11 |
23 | reyssat | 10 | ecnt=!recordcnt wimshome/log/classes/$wims_class/sheets/.sheet$sheet |
11 | !for e=1 to $ecnt |
||
12555 | bpr | 12 | exo_$e=!record $e of wimshome/log/classes/$wims_class/sheets/.sheet$sheet |
13 | exo_$e=!line 1 to $number_field of $(exo_$e)\ |
||
23 | reyssat | 14 | \ |
15 | \ |
||
16 | \ |
||
17 | \ |
||
18 | \ |
||
19 | \ |
||
20 | \ |
||
21 | \ |
||
4530 | bpr | 22 | \ |
12316 | bpr | 23 | \ |
15763 | guerimand | 24 | \ |
23 | reyssat | 25 | |
26 | !next e |
||
27 | !if $update_field>=0 |
||
12555 | bpr | 28 | !if $update_field>0 |
29 | tmp=!linecnt $(exo_$exo) |
||
30 | !if $update_field > $tmp |
||
31 | !for tmp2 = 1 to $[$update_field-$tmp] |
||
32 | exo_$exo=!append line $ $ to $(exo_$exo) |
||
33 | !next |
||
34 | !endif |
||
35 | exo_$exo=!replace line number $update_field by $update_content in $(exo_$exo) |
||
36 | !else |
||
37 | exo_$exo=$update_content |
||
4863 | bpr | 38 | !endif |
23 | reyssat | 39 | !endif |
40 | !writefile wimshome/log/classes/$wims_class/sheets/.sheet$sheet |
||
41 | !for e=1 to $ecnt |
||
12555 | bpr | 42 | !if $e!=$exo or $update_field>=0 |
43 | ef=!line 1 to $number_field of $(exo_$e) |
||
44 | !appendfile wimshome/log/classes/$wims_class/sheets/.sheet$sheet :$ef |
||
45 | !endif |
||
23 | reyssat | 46 | !next e |