
!read scripts/edfile.proc
!if $error!=$empty
 !exit
!endif

!for v in Prev, Next, Upbl
 v_=!word 1 of $($v)
 v_=!text select $namechars in $v_
 $v=!char 1 to $namelim of $v_
!endif

Dat1=!text select 0123456789 in $Dat1
Dat2=!text select 0123456789 in $Dat2
!bound Dat1 between integer 19000101 and 24000101 default 19000101
!bound Dat2 between integer 19000101 and 24000101 default 24000101

Titb=!translate internal !$$ to $  $ in $Titb
Keyw=!translate internal !$$ to $  $ in $Keyw
Titb=!singlespace $Titb
Keyw=!singlespace $Keyw
t_=!charcnt $Titb
!if $t_>$titlim
 Titb=!detag $Titb
 Titb=!trim $Titb
 Titb=!char 1 to $titlim of $Titb
!endif
!default Titb=??
Keyw=!detag $Keyw
Keyw=!char 1 to $titlim of $Keyw

today=!char 1 to 8 of $wims_now

!writefile $docdir/$doc/$block.def !set titb=$Titb\
!set keyw=$Keyw\
!set datm=$today\
!set prev=$Prev\
!set next=$Next\
!set upbl=$Upbl\
!set dat1=$Dat1\
!set dat2=$Dat2\
\
!if $$wims_read_parm!=$$empty\
 !goto $$wims_read_parm\
!endif\
\
!exit\
\
:content

src=$wims_home/$wims_sesdir/doc.src
dest=$wims_home/$Docdir/$doc/src/$block
!mexec scripts/copy.sh

src=$wims_home/$wims_sesdir/doc.def
dest=$wims_home/$Docdir/$doc/$block.def
!mexec scripts/append.sh
!read $docdir/$doc/$block.def

!read index.proc

job=read
!changeto read.proc
