FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Problem with oBRW:report() and deleted records
Posts: 130
Joined: Fri Jun 30, 2006 02:14 PM
Problem with oBRW:report() and deleted records
Posted: Fri Oct 10, 2008 06: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

Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Problem with oBRW:report() and deleted records
Posted: 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

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 130
Joined: Fri Jun 30, 2006 02:14 PM
Problem with oBRW:report() and deleted records
Posted: Fri Oct 10, 2008 02:00 PM

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

Regards,
Max

Continue the discussion