Yiour error message suggest that you have ended up
in an infinit loop.

> > IF ($len<=41):
> >   WHILE ($i<>0):
> >    IF ($asunto[$i]==" "):    *************This is line 116
> >     $corte1=$i;
> >     $i=0;
> >    ENDIF;
>    $i=$i + 1;
>   ENDWHILE;

It seams like this IF statement control weather you
can break the WHILE loop or not. So the question is:

Have you tried to put a space at the end of the
line to guarantee that you can break the loop in
case a line just happens to contain no spaces at
all?

Instead of the above construction, you can add some
extra "sanity check" code to make sure that you always
can break the loop in a controlled manner.

   $LoopCnt = 0 ;
   $MAX_ITTERATIONS = <SOME SENCIBLE VALUE>;

    WHILE ($i<>0 && $LoopCnt < $MAX_ITTERATIONS):
    $LoopCnt++;
 
       IF ($asunto[$i]==" "):    *************This is line 116
         $corte1=$i;
         $i=0;
      ENDIF;

     $i=$i + 1;
    ENDWHILE;
    
    IF ($i <> 0 )
        /* code for handle this kind of exception */
    ENDIF;


I would also like to suggest that you initiate $i to a
know value before you enter the loop construction.

By the way, it is always a good programming habit to initiate
variables to a know value before using them; that way one
will avoid a lot of annoying behavior with the code.


-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to