[Gambas-user] Bug: FEditor

Benoit Minisini gambas at ...1...
Sat Mar 20 01:18:39 CET 2004


On Friday 19 March 2004 09:56, ron wrote:
> 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 ?
>

No, just RETURN.

-- 
Benoit Minisini
mailto:gambas at ...1...




More information about the User mailing list