Problem with oBRW:report() and deleted records

Problem with oBRW:report() and deleted records

Postby max » Fri Oct 10, 2008 6:05 am

I use oBRW:report() with XBROWSE for printing what i have in the browse. I note that if there are some records deleted, not visible in browse since i use SET DELETE ON, the oBRW:report() print a number of records equal to the number of total records of my dbf, including the deleted records. And the content of the records deleted is the same of the last logic record. Example:
rec. 1 "TEST"
rec. 2 "TEST2"
rec. 3 "TEST3" (deleted)
rec. 4 "TEST4" (deleted)
rec. 5 "TEST5"

in xbrowse i see regularly three row, with TEST , TEST2 and TEST5. Using oBRW:report() of my xbrowse, the result is:
TEST
TEST2
TEST5
TEST5 (?)
TEST5 (?)

I have to "pack" my dbf for working right the oBRW:report().
There is a bug or i can use something different work like SET DELETE ON or ... what?
Thank you.


FWH 8.04 + XHARBOUR 1.1.0
User avatar
max
 
Posts: 128
Joined: Fri Jun 30, 2006 2:14 pm
Location: Ancona - Italy

Postby James Bott » Fri Oct 10, 2008 12:36 pm

Max,

This is because the report uses keyCount() as the total number of records rather than just printing till eof().

The simple solution is to do your index with the FOR ! DELETED() clause. This also will make scrollbars more accurate. Note that you still need to SET DELETED ON.

Regards,
James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby max » Fri Oct 10, 2008 2:00 pm

Thank you James, now oBRW:report() works fine!

Regards,
Max
User avatar
max
 
Posts: 128
Joined: Fri Jun 30, 2006 2:14 pm
Location: Ancona - Italy


Return to FiveWin for Harbour/xHarbour

Who is online

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