File: recordshift

package info (click to toggle)
wims 2%3A4.29a%2Bdfsg1-3
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 185,704 kB
  • sloc: xml: 366,687; javascript: 120,570; ansic: 62,341; java: 62,170; sh: 7,744; perl: 3,937; yacc: 3,217; cpp: 1,915; lex: 1,805; makefile: 1,084; lisp: 914; pascal: 601; python: 520; php: 318; asm: 7
file content (20 lines) | stat: -rw-r--r-- 688 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
!!
!! move a field of a record to another position
!!
!! needed information :
!! target_field : the position where the field be inserted after (next are translated).
!! source_field : the position of the source field
!! wims_read_parm : name of record

ecnt_=!recordcnt $wims_read_parm
!for e_=1 to $ecnt_
  field_$e_=!record $e_ of $wims_read_parm
!next e_
list_=!values v for v=1 to $ecnt_
list_=!replace item number $source_field by $empty in $list_
list_=!replace item $target_field by $target_field,$source_field in $list_
list_=!nonempty item $list_
!writefile $wims_read_parm :$(field_$(list_[1]))
!for e_=2 to $ecnt_
  !appendfile $wims_read_parm :$(field_$(list_[$e_]))
!next e_