FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour XBROWSE : ERROR in method eval
Posts: 166
Joined: Wed Aug 29, 2012 08:25 AM
XBROWSE : ERROR in method eval
Posted: Tue Apr 02, 2013 03:52 PM
FWH 1303

line 6737 : if ::GoDown() < 1

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

return nil

Frank

Solved as :

Code (fw): Select all Collapse
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
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: XBROWSE : ERROR in method eval
Posted: Tue Apr 09, 2013 02: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
Posts: 166
Joined: Wed Aug 29, 2012 08:25 AM
Re: XBROWSE : ERROR in method eval
Posted: Tue Apr 09, 2013 08: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 (fw): Select all Collapse
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

Continue the discussion