FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour ERROR USING TDABASE
Posts: 36
Joined: Sat Jun 19, 2010 10:09 AM
ERROR USING TDABASE
Posted: Tue Oct 11, 2011 06:07 PM

hello all, I'm having trouble in TDatabase;
I called a number field prcims type number with two decimal places.
and its value is zero.
If I? tdabase-> pricms shows zero, so far ok.
now if TDatabase phaco-> pricms> 0 always returns true and q is zero value.
if I do without the table-type if tdabase> pricms operate normally.
Can someone help me?

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: ERROR USING TDABASE
Posted: Tue Oct 11, 2011 10:19 PM
Can you post a small sample code to reproduce this error, using any of the dbf files in the fivewin samples folder?

Our tests are running correctly.
For example,
Code (fw): Select all Collapse
   oDbf := TDataBase():Open( , "c:\fwh\samples\customer.dbf" )
   ? oDbf:Salary  // --> 5900.00
Regards



G. N. Rao.

Hyderabad, India
Posts: 36
Joined: Sat Jun 19, 2010 10:09 AM
Re: ERROR USING TDABASE
Posted: Sat Oct 15, 2011 01:15 PM

The problem is, I have a variable number that compares the field tdabase: this value is greater than variable and always returns true, and demonstrate command to see the field and the field is reset. example:

LOCAL nvalor:=0

IF odbf:valor > nvalor
RETURN( .F. )
ENDIF

most always returns true, and both are zero, both the variable as the table field that is numeric.

Posts: 1515
Joined: Thu Oct 30, 2008 02:37 PM
Re: ERROR USING TDABASE
Posted: Sat Oct 15, 2011 03:10 PM
gss200610,

can you try this code ?

Code (fw): Select all Collapse
  
LOCAL nvalor:=0

IF Val(Str(odbf:valor)) > nvalor
RETURN( .F. )
ENDIF


regards
Posts: 159
Joined: Wed Mar 28, 2007 01:19 PM
Re: ERROR USING TDABASE
Posted: Sat Oct 15, 2011 03:54 PM
gss200610,
the code below does not show error
(of course, all the VALOR fields are zeroes) :-)
Code (fw): Select all Collapse
Function main()
local oDbf, nVlr:=0, nCnt:=0
use arquivo
DATABASE oDbf
do while !eof()
   nCnt++
   if oDbf:valor > nVlr
      MsgInfo(nCnt, " ERROR")
   endif 
   oDbf:skip()
enddo
   MsgInfo(nCnt, " END")
return nil

regards, Euclides

Continue the discussion