Page 1 of 1

TData with 10.3

PostPosted: Thu Apr 08, 2010 6:17 pm
by Otto
Hello James,
would you be so kind to help me.
I updated to version 10.3. Now if I try to open a certain dbf-file I get following error:

Code: Select all  Expand view
Application
===========
   Path and name: C:\xwinhotel\xwinhotel.EXE (32 bits)
   Size: 3,633,152 bytes
   Time from start: 0 hours 0 mins 4 secs
   Error occurred at: 08.04.2010, 20:08:03
   Error description: Error BASE/1111  Argument error: LEN
   Args:
     [   1] = U  

Stack Calls
===========
   Called from:  => LEN(0)
   Called from: .\source\classes\DATABASE.PRG => (b)TDATABASE:TDATABASE(99)
   Called from:  => TDATA:FCOUNT(0)
   Called from: .\source\classes\DATABASE.PRG => TDATA:LOAD(657)
   Called from: ..\SOURCE\TDATA.PRG => TDATA:USE(555)
   Called from: C:\develop8\WH_Fwh\XWINHO~1\WINHOTEL.PRG => MAIN(0)

System
======
 



If I link in FIVEWIN database.prg from a previous version all is working.
Thanks in advance
Otto

Re: TData with 10.3

PostPosted: Thu Apr 08, 2010 7:06 pm
by nageswaragunupudi
If you use TDatabase class as in FWH database.prg there should be no problem. Version 10.3 TDatabase class works well. You may check browing of database object in the sample testxbr3.prg.

I understand, TData class is derived from TDatabase class of FWH. TDatabase class has a DATA aStruct. From version 10.2 onwards this is the change in the method FCount() in tdatabase class of FWH

Upto version 10.1
Code: Select all  Expand view
  METHOD FCount()            INLINE ( ::nArea )->( FCount() )

From version 10.2
Code: Select all  Expand view
  METHOD FCount()            INLINE Len( ::aStruct )
 

This change was necessary due to several other improvements in tdatabase.prg. From the above error, I understand that the TData class is not maintaining the DATA aStruct and therefore Len(::aStruct) fails.

One solution is to override method FCount() in the derived class in your application ( or Tdata class ).

In your derived class:
Code: Select all  Expand view
  METHOD FCount()            INLINE ( ::nArea )->( FCount() )

Re: TData with 10.3

PostPosted: Thu Apr 08, 2010 7:26 pm
by norberto
i have the same problem... can someone contact james bott to try any solution? thanks

Re: TData with 10.3

PostPosted: Fri Apr 09, 2010 12:09 am
by nageswaragunupudi
Similar to FCount(), FieldPos() also is changed.

Re: TData with 10.3

PostPosted: Fri Apr 09, 2010 4:30 pm
by TimStone
I discussed this with James last month. Here is the solution:

Remove the line and add the line shown below in the Use() method of TData. Just put the new line right were the old line was.

//::load() // Remove this line
::setArea( ::nArea ) // New for TDatabase 10.02

Re: TData with 10.3

PostPosted: Fri Apr 09, 2010 5:05 pm
by James Bott
Otto and Norberto,

See your private email for an updated copy of TData.

Regards,
James

Re: TData with 10.3

PostPosted: Fri Apr 09, 2010 6:10 pm
by norberto
hi james, very thanks... my email is norberto@windowslive.com

Re: TData with 10.3

PostPosted: Fri Apr 09, 2010 6:43 pm
by mmercado
Dear James:
James Bott wrote:See your private email for an updated copy of TData.

I'll be checking my email every minute from now :D

Best regards.