FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour oBrw:KeyCount() inexacto (SOLUCIONADO)
Posts: 257
Joined: Tue May 16, 2006 04:46 PM
oBrw:KeyCount() inexacto (SOLUCIONADO)
Posted: Thu May 21, 2015 07:32 PM

Hola amigos,

Bajo xBrowse uso oBrw:KeyCount() para indicarle al usuario el numero de lineas que incluye la lista que esta viendo que incluye algunos filtros, sinembargo a veces no coincide el valor que me arroja oBrw:KeyCount() con el numero de lineas que realmente me esta mostrando. Por ejemplo, oBrw:KeyCount() me da 49 y si cuento fisicamente las lineas o si las cuento usando DBSKIP(1) en un DO WHILE !EOF() son solo 45.

A alguien le ha sucedido algo similar?

RodolfoRBG
FWH 1307, xHarbour123 BCC582
rodolfoerbg@gmail.com
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: oBrw:KeyCount() inexacto
Posted: Fri May 22, 2015 01:21 AM

oBrw:KeyCount() returns the result of OrdKeyCount().

By default, OrdKeyCount() includes deleted records also.
To get the correct number of records, excluding deleted records, we should include "!DELETED()" in the filter condition.

Example:
USE CUSTOMER
? OrdKeyCount() --> Number of all records including deleted records.
SET FILTER TO !DELETED()
GO TOP
? OrdKeyCount() --> Number of all records excluding deleted records.

If we want the oBrw:KeyCount(), oBrw:KeyNo() to work precisely, we need to SET FILTER TO !DELETED().
If we set some other filter like SET FILTER TO AGE > 30, then we should SET FILTER TO AGE > 30 .AND. !DELETED().

Regards



G. N. Rao.

Hyderabad, India
Posts: 257
Joined: Tue May 16, 2006 04:46 PM
Re: oBrw:KeyCount() inexacto (RESUELTO)
Posted: Fri May 22, 2015 02:46 PM

Now it works! Thanks!!!

RodolfoRBG
FWH 1307, xHarbour123 BCC582
rodolfoerbg@gmail.com

Continue the discussion