a tree with tdatabase give me error

a tree with tdatabase give me error

Postby Silvio.Falconi » Thu Jan 26, 2023 12:09 pm

I tried to converte a tree into Tdatabase but make me error

I open the database with tdatabase

Code: Select all  Expand view
    ::oTabMag:= TTabMag():New()
    ::oTabMag:SetOrder(1 )
    ::oTabMag:GoTop()
    ::oTreeMag    := ::MakeTree()
 


the error
Code: Select all  Expand view
  Error description: Error BASE/1004  Class: 'NIL' has no exported method: CARGO
   Args:
     [   1] = U  

Stack Calls
===========
   Called from:  => CARGO( 0 )
   Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:SETCOLSFORTREE( 7990 )
   Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:SETTREE( 7943 )
   Called from: .\source\classes\XBROWSE.PRG => XBRWSETDATASOURCE( 17605 )
   Called from: .\source\classes\XBROWSE.PRG => XBROWSENEW( 17348 )
   Called from: source\Categorie\TCategorie.prg => TTABCAT:NEW( 135 )







Image



the original
Code: Select all  Expand view
static function MakeTree()

   field CODICE
   local oTree
   local c1, c2, c3


   USE "TABMAG" NEW SHARED
   INDEX ON CODICE TAG CODICE TO TMP MEMORY
   GO TOP



   TREE oTree
   do while ! eof()
      TREEITEM CODICE CARGO { FIELD->DESC }
      c1    := Left( CODICE, 2 )
      SKIP
      TREE
      do while Left( CODICE,2 ) == c1
         TREEITEM CODICE CARGO { FIELD->DESC }
         c2    := Left( CODICE, 4 )
         SKIP
         TREE
         do while Left( CODICE, 4 ) == c2
            TREEITEM CODICE CARGO { FIELD->DESC }
            SKIP
         enddo
         ENDTREE
      enddo
      ENDTREE
   enddo
   ENDTREE

   oTree:OpenAll()

   CLOSE TAG

return oTree



My test

Code: Select all  Expand view


METHOD MakeTree() CLASS TTabCat
   FIELD CODICE

   local oTree
   local c1, c2, c3

   ::oTabMag:gotop()

  // USE "TABMAG" NEW SHARED
  // INDEX ON CODICE TAG CODICE TO TMP MEMORY
 //  GO TOP

 TREE oTree
   do while ! ::oTabMag:eof()
      TREEITEM ::oTabMag:CODICE CARGO { ::oTabMag:DESC }
      c1    := Left( ::oTabMag:CODICE, 2 )
      ::oTabMag:skip()
      TREE
      do while Left( ::oTabMag:CODICE,2 ) == c1
         TREEITEM ::oTabMag:CODICE CARGO { ::oTabMag:DESC }
         c2    := Left( ::oTabMag:CODICE, 4 )
         ::oTabMag:skip()
         TREE
         do while Left( ::oTabMag:CODICE, 4 ) == c2
            TREEITEM ::oTabMag:CODICE CARGO { ::oTabMag:DESC }
            ::oTabMag:skip()
         enddo
         ENDTREE
      enddo
      ENDTREE
   enddo
   ENDTREE

   oTree:OpenAll()

return oTree
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7061
Joined: Thu Oct 18, 2012 7:17 pm

Re: a tree with tdatabase give me error

Postby nageswaragunupudi » Mon Jan 30, 2023 9:35 pm

Will you please send me the DBF ?
Regards

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

Re: a tree with tdatabase give me error

Postby Silvio.Falconi » Tue Jan 31, 2023 8:35 am

nageswaragunupudi wrote:Will you please send me the DBF ?

I sent you the test run with nomale use dbf , I wish use tdatabase
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7061
Joined: Thu Oct 18, 2012 7:17 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: betoncu, Google [Bot] and 94 guests

cron