Hi,

Am Freitag, 27. Jul 2007, 00:21:31 +0900 schrieb Ben Bleything:
> On Thu, Jul 26, 2007, Tonyrrr Tonyroor wrote:
> >    if ((( chaine[i+14] == "twincards>false</twincards")||(chaine[i+14]
> > == "twincards>true</twincards"))|| ( chaine[ i+14]== "twincards
> > xsi:nil="1"/"))
> 
> You're closing one too many sets of parents after the "true"
> conditional.
> 
> You might want to rewrite it for better legibility, too.  A suggestion:
> 
>   test = chaine[ i + 14 ]
>   if test == 'twincards>false</twincards' or
>      test == 'twincards>true</twincards'  or
>      test == 'twincards xsi:nil="1"/'

It's not only legibility, it's enough to calculate c[i+14]
once as the result is every time the same.

Another suggestion:

  case chaine[ i+14]
    when %r{twincards>(true|false)</twincards},
         %q{twincards xsi:nil="1"/}             then
      ...
  end

Bertram


-- 
Bertram Scharpf
Stuttgart, Deutschland/Germany
http://www.bertram-scharpf.de