Subversion Repositories wimsdev

Rev

Rev 12330 | Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
9623 guerimand 1
!! updatefield of a record
2
!! wims_read_parm should be by line :
3
!! file
4
!! num of field
5
!! optionword
6
!! all other lines : new data for the field num
7
!!
8
!! option allow :
9
!! delete : in this case field num will be deleted
10
 
11
file_=!line 1 of $wims_read_parm
12
num_=!line 2 of $wims_read_parm
13
option_=!line 3 of $wims_read_parm
14
data_=!line 4 to -1 of $wims_read_parm
15
 
16
nbrec_=!recordcnt $file_
17
newrecord_=$empty
18
!if $num_>1
19
    !for k_=1 to $num_-1
20
	tmp_=!record $k_ of $file_
21
	newrecord_=!append line :$tmp_ to $newrecord_
22
    !next k_
23
!endif
24
!if delete notwordof $option_
25
 newrecord_=!append line :$data_ to $newrecord_
26
!endif
27
!if $num_<$nbrec_
28
    !for k_=$num_+1 to $nbrec_
29
	tmp_=!record $k_ of $file_
30
	newrecord_=!append line :$tmp_ to $newrecord_
31
    !next k_
32
!endif
33
!writefile $file_ $newrecord_