Subversion Repositories wimsdev

Rev

Rev 12316 | Go to most recent revision | 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
12316 bpr 9
number_field=10
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
\
23 reyssat 24
 
25
!next e
26
!if $update_field>=0
12555 bpr 27
  !if $update_field>0
28
    tmp=!linecnt $(exo_$exo)
29
    !if $update_field > $tmp
30
      !for tmp2 = 1 to $[$update_field-$tmp]
31
        exo_$exo=!append line $ $ to $(exo_$exo)
32
      !next
33
    !endif
34
    exo_$exo=!replace line number $update_field by $update_content in $(exo_$exo)
35
  !else
36
    exo_$exo=$update_content
4863 bpr 37
  !endif
23 reyssat 38
!endif
39
!writefile wimshome/log/classes/$wims_class/sheets/.sheet$sheet
40
!for e=1 to $ecnt
12555 bpr 41
  !if $e!=$exo or $update_field>=0
42
    ef=!line 1 to $number_field of $(exo_$e)
43
    !appendfile wimshome/log/classes/$wims_class/sheets/.sheet$sheet :$ef
44
  !endif
23 reyssat 45
!next e