XBROWSE : ERROR in method eval

XBROWSE : ERROR in method eval

Postby Franklin Demont » Tue Apr 02, 2013 3:52 pm

FWH 1303

line 6737 : if ::GoDown() < 1

::Godown() seems to return nil , last line from godown() :

return nil

Frank

Solved as :

Code: Select all  Expand view

METHOD Eval( bBlock, bFor, bWhile, nNext, nRec, lRest ) CLASS TXBrowse
...
local MemRecno
...

do while nRow++ <= ::nLen .and. Eval( bWhile, Self )                         
    if Eval( bFor, Self )
        Eval( bBlock, Self )
    endif
    MemRecno := EVAL(::bKeyNo)
    ::GoDown()
    IF MemRecno == EVAL(::bKeyNo)
        exit
    END
     //if ::GoDown() < 1
     //    exit
     //endif
 
test
Franklin Demont
 
Posts: 166
Joined: Wed Aug 29, 2012 8:25 am

Re: XBROWSE : ERROR in method eval

Postby nageswaragunupudi » Tue Apr 09, 2013 2:36 pm

Thanks for pointing out.

Instead of your modification, please try modifying "return nil" as "return nDown" at the end of Method GoDown().

This is implemented in the next release.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10632
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: XBROWSE : ERROR in method eval

Postby Franklin Demont » Tue Apr 09, 2013 8:20 pm

nageswaragunupudi wrote:Thanks for pointing out.

Instead of your modification, please try modifying "return nil" as "return nDown" at the end of Method GoDown().

This is implemented in the next release.


i didn't trust to change the return value , there can be elsewhere also a test on this value


I noticed also that 'nNext' isn't processed

I made a substitution for this method :

Code: Select all  Expand view

STATIC FUNC BrwEval(bBlock, bFor, bWhile, nNext, nRec, lRest ) //CLASS TXBrowse method eval has errors !!!!!
   local Self        := HB_QSelf()
   local lFromTop    := bWhile == nil .and. nNext == nil .and. nRec == nil .and. Empty( lRest )
   local nSaveSelect := nil
   local uBookMark
   local nRow        := 0
     //# ifdef FRANKDEMONT
     local MemRecno , nCount := 1 , bNext
     //# endif

   DEFAULT bBlock := { || nil }, bFor := { || .t. }, bWhile := { || .t. }, ;
                     nRec := 0, lRest := .t.

   
     IF nNext == nil
        bNext  := {||.T.}
     ELSEIF ValType(nNext) == "N"
        IF nNext < 1
            bNext := {||.F.}
        ELSE
            bNext := {||nCount <= nNext}
        END
     END

   if ::nDataType == DATATYPE_RDD .and. ! Empty( ::cAlias )
      nSaveSelect := SELECT()
      SELECT( ::cAlias )
   endif

   uBookMark      := Eval( ::bBookMark )
   if lFromTop
      ::GoTop()
   endif
   if nRec > 0
      ::KeyNo( nRec )
      Eval( bBlock, Self )
   else
      do while nRow++ <= ::nLen .and. Eval( bWhile, Self )  .AND. EVAL(bNext)            
                 
                 if Eval( bFor, Self )
            Eval( bBlock, Self )
         endif               
                 MemRecno := EVAL(::bKeyNo)
                 ::GoDown()
                 IF MemRecno == EVAL(::bKeyNo)
                    exit
                 END
                 nCount++
      enddo
     endif

     MemRecno := EVAL(::bKeyNo)

   Eval( ::bBookMark, uBookMark )
   if ! Empty( nSaveSelect )
      Select( nSaveSelect )
   endif
   ::Refresh()

return MemRecNo
*/
 


Frank
test
Franklin Demont
 
Posts: 166
Joined: Wed Aug 29, 2012 8:25 am


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 68 guests

cron