[Gambas-user] Bug: FEditor

ron ronstk at ...239...
Fri Mar 19 09:56:07 CET 2004


On Thursday 18 March 2004 23:21, Benoit Minisini wrote:
> On Thursday 18 March 2004 17:55, ron wrote:
> > Hallo Benoit
> >
> > I had several times an error in FEditor with fatal result and closing all
> > without it is saved. :(
> >
> > Function is IsCurrentProc()
> > line 598
> > ------------------
> >  FOR iPos = 0 TO aLine.Count - 1
> > .....
> >     IF aLine[iPos] = "FUNCTION" THEN
> >       bProc = TRUE
> >       BREAK
> >     ENDIF
> >  ...
> >   NEXT
> >
> >   IF bProc THEN $sName = aLine[iPos + 1]  '<----------- 598
> >
> >   RETURN bProc
> > END
> > ------------------
> > I do not know when exactly this function runs but asuming FUNCTION can be
> > the last line then iPos is already at the last line
> > With the BREAK in continues after NEXT
> > bProc=True and then iPos + 1  is out of bounds !
>
> I just have fixed this bug! Replace:
>
>   IF bProc THEN $sName = aLine[iPos + 1]  '<----------- 598
>
> by the following:
>
>   IF bProc THEN
>
>     INC iPos
>     IF iPos >= aLine.Count THEN RETURN ' <----
>
>     $sName = aLine[iPos]
>
>   ENDIF
>
>
> Sorry for the bug!
>
> Regards,

I asume the RETURN must be RETURN bProc ?

Pitty it was, Happy I found. It are always this smal ones.






More information about the User mailing list