Subversion Repositories wimsdev

Rev

Rev 17333 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
17333 guerimand 1
!! check if sheet have reference to technical variable not defined in the class
2
!! hidden_condition is not checked (done in var.proc directly not a activate problem)
3
!! wims_read_parm is keyword 
4
!! clean : cleaning the sheet from individual technical variable data
5
!! empty : just check if techvar is in use for individualisation of sheet
6
!!         in this case listvalues is the list of values used
7
!!                      listcompatibletechvar is the list of technival variable compatible with listvalues
8
!if $wims_read_parm=clean
9
  !goto clean
10
!endif
11
 
12
!! ---------------- process to check usage of technical variable
13
!reset listvalues listcompatibletechvar
14
data_=!record $sheet of wimshome/log/classes/$wims_class/.sheets
15
!! -------- check for individualisation sheet parameter
16
ecnt=!recordcnt wimshome/log/classes/$wims_class/sheets/.sheet$sheet
17
!for k_=1 to $ecnt
18
  d_=!record $k_ of wimshome/log/classes/$wims_class/sheets/.sheet$sheet
19
  lt_=!line 11 of $d_
20
  !if $lt_!=$empty
21
    listvalues=!append item $lt_ to $listvalues
22
  !endif
23
!next k_
24
listvalues=!listuniq $listvalues
17469 guerimand 25
!if $listvalues=$empty
26
  !exit
27
!endif
17333 guerimand 28
!! calculate compatible technical variable
29
nb_=!recordcnt wimshome/log/classes/$wims_class/.techvar
30
t_=!itemcnt $listvalues
31
!for k_=1 to $nb_
32
  dt_=!record $k_ of wimshome/log/classes/$wims_class/.techvar
33
  !distribute line $dt_ into name_,val_
34
  t2_=!listintersection $val_ and $listvalues
35
  t2_=!itemcnt $t2_
36
  t3_=!itemcnt $val_
37
  !if $t2_=$t_ and $t3_=$t2_
38
    listcompatibletechvar=!append item $name_ to $listcompatibletechvar
39
  !endif
40
!next k_
17469 guerimand 41
!if $indivtechvar!=$empty
42
  !reset t2_,t3_
43
  t2_=!positionof item $indivtechvar in $tv_listlocalcode
44
  t3_=!item $t2_ of $tv_listlocalname
45
  !if $t2_!=$empty and $t3_ isitemof $listcompatibletechvar
46
    !reset listvalues listcompatibletechvar
47
  !endif
48
!endif
17333 guerimand 49
!exit
50
 
51
:clean
52
!! ---- process to clean sheet 
53
data_=!record $sheet of wimshome/log/classes/$wims_class/sheets/.sheets
54
a_=!line 1 of $data_
55
!if $a_!=0
56
  !exit
57
!endif
58
update_content=!replace line number 11 by $empty in $data_
59
update_field=$sheet
60
!readproc adm/uprecord wimshome/log/classes/$wims_class/sheets/.sheets
61
!sh mv $wims_home/log/classes/$wims_class/sheets/.sheet$sheet $wims_home/log/classes/$wims_class/sheets/.sheettmp
62
nb_=!recordcnt wimshome/log/classes/$wims_class/sheets/.sheettmp
63
!for k_=1 to $nb_
64
  dt_=!record $k_ of wimshome/log/classes/$wims_class/sheets/.sheettmp
65
  !for j_=3 to 4
66
    t_=!line $j_ of $dt_
67
    t_=!row 1 of $t_
68
    dt_=!replace line number $j_ by $t_ in $dt_
69
  !next j_
70
  dt_=!replace line number 11 by $empty in $dt_
71
  !appendfile wimshome/log/classes/$wims_class/sheets/.sheet$sheet :$dt_
72
!next k_
73
!sh rm -f $wims_home/log/classes/$wims_class/sheets/.sheettmp