Subversion Repositories wimsdev

Rev

Rev 13102 | Blame | Compare with Previous | Last modification | View Log | RSS feed

!!for the documentation
option:noreaccent symbols=" "

good=!singlespace $(replygood$i)
good=!rows2lines $good
good=!nonempty lines $good
badwords=!line 2 to -1 of $good
good=!line 1 of $good
good=!trim $good
!if noreaccent notwordof $(replyoption$i)
  reply$i=!reaccent $(reply$i)
  badchars=-+/*='"`.;,!|{}*@#$$%^&()[]?<>\~
  repchars=$                                     $
!else
  badchars=-+/*="`.;,!|{}*@#$$%^&()[]?<>\~
  repchars=$                                    $
!endif
badwords=!translate internal $badchars to $repchars in $badwords
rtest=!translate internal $badchars to $repchars in $(reply$i)
dd=!singlespace $rtest
dd=!trim $dd

m_reply$i=$dd
!if $wims_read_parm=nocompare
  !exit
!endif

!if $good=$empty
  Test=bad $i
  !exit
!endif

diag=
good=!translate | to $\
$ in $good
gtest=!translate internal $badchars to $repchars in $good
good=!nonempty lines $good
replyGood$i=!line 1 of $good
gtest=!translate | to $\
$ in $gtest
gtest=!nonempty lines $gtest
t_=!linecnt $gtest
!for n=1 to $t_
  g=!line $n of $gtest
  g=!singlespace $g
  g=!trim $g
  !if $dd=$g
    diag=yes
  !endif
!next n

!if $diag=yes
  diareply$i=good
  !advance freegot
!else
  bn=!wordcnt $badwords
  !if $bn>0
    dt=!words2items $rtest
    !for w in $dt
      !if $w notwordof $gtest $badwords
        test=NaN unknownword $w
        !exit
      !endif
    !next w
  !endif
  diareply$i=bad
!endif