Rev 4176 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4176 | Rev 5665 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 |
|
1 | !!!!!!!!!!!!!!!!!!!!!!!!!!! |
2 | !! |
- | |
3 |
|
2 | !! DEPRECATED : now use adm/class/update.exo |
4 |
|
3 | !!!!!!!!!!!!!!!!!!!!!!!!!!! |
5 |
|
4 | error= scripts/update.exo is deprecated. use adm/class/update.exo instead. |
6 |
|
5 | !exit |
7 | 6 | ||
- | 7 | !! |
|
- | 8 | !! update a field of an exo of a sheet |
|
- | 9 | !! |
|
- | 10 | !! needed information : |
|
- | 11 | !! sheet : sheet to modify |
|
- | 12 | !! exo : id of exo to be modified in the sheet |
|
- | 13 | !! update_field : is the numbrer of the field to be modified. |
|
- | 14 | !! update_content : new content |
|
- | 15 | number_field=9 |
|
8 | ecnt=!recordcnt wimshome/log/classes/$wims_class/sheets/.sheet$qsheet |
16 | ecnt=!recordcnt wimshome/log/classes/$wims_class/sheets/.sheet$qsheet |
9 | !for e=1 to $ecnt |
17 | !for e=1 to $ecnt |
10 | exo_$e=!record $e of wimshome/log/classes/$wims_class/sheets/.sheet$qsheet |
18 | exo_$e=!record $e of wimshome/log/classes/$wims_class/sheets/.sheet$qsheet |
11 | exo_$e=!line 1 to |
19 | exo_$e=!line 1 to $number_field of $(exo_$e)\ |
- | 20 | \ |
|
12 | \ |
21 | \ |
13 | \ |
22 | \ |
14 | \ |
23 | \ |
15 | \ |
24 | \ |
16 | \ |
25 | \ |
Line 19... | Line 28... | ||
19 | \ |
28 | \ |
20 | 29 | ||
21 | !next e |
30 | !next e |
22 | !if $update_field>=0 |
31 | !if $update_field>=0 |
23 | !if $update_field>0 |
32 | !if $update_field>0 |
- | 33 | tmp=!linecnt $(exo_$exo) |
|
- | 34 | !if $update_field > $tmp |
|
- | 35 | !for tmp2 = 1 to $[$update_field-$tmp] |
|
- | 36 | exo_$exo=!append line $ $ to $(exo_$exo) |
|
- | 37 | !next |
|
- | 38 | !endif |
|
24 | exo_$exo=!replace line number $update_field by $update_content in $(exo_$exo) |
39 | exo_$exo=!replace line number $update_field by $update_content in $(exo_$exo) |
25 | !else |
40 | !else |
26 | exo_$exo=$update_content |
41 | exo_$exo=$update_content |
27 | !endif |
42 | !endif |
28 | !endif |
43 | !endif |
29 | !writefile wimshome/log/classes/$wims_class/sheets/.sheet$qsheet |
44 | !writefile wimshome/log/classes/$wims_class/sheets/.sheet$qsheet |
30 | !for e=1 to $ecnt |
45 | !for e=1 to $ecnt |
31 | !if $e!=$exo or $update_field>=0 |
46 | !if $e!=$exo or $update_field>=0 |
32 | ef=!line 1 to |
47 | ef=!line 1 to $number_field of $(exo_$e) |
33 | !appendfile wimshome/log/classes/$wims_class/sheets/.sheet$qsheet :$ef |
48 | !appendfile wimshome/log/classes/$wims_class/sheets/.sheet$qsheet :$ef |
34 | !endif |
49 | !endif |
35 | !next e |
50 | !next e |
36 | 51 |