oBrw:KeyCount() inexacto (SOLUCIONADO)

Post Reply
User avatar
RodolfoRBG
Posts: 253
Joined: Tue May 16, 2006 4:46 pm
Location: San Luis Potosi, SLP, Mexico
Contact:

oBrw:KeyCount() inexacto (SOLUCIONADO)

Post by RodolfoRBG »

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?
Last edited by RodolfoRBG on Fri May 22, 2015 2:47 pm, edited 1 time in total.
RodolfoRBG
FWH 1307, xHarbour123 BCC582
rodolfoerbg@gmail.com
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: oBrw:KeyCount() inexacto

Post by nageswaragunupudi »

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
User avatar
RodolfoRBG
Posts: 253
Joined: Tue May 16, 2006 4:46 pm
Location: San Luis Potosi, SLP, Mexico
Contact:

Re: oBrw:KeyCount() inexacto (RESUELTO)

Post by RodolfoRBG »

Now it works! Thanks!!!
RodolfoRBG
FWH 1307, xHarbour123 BCC582
rodolfoerbg@gmail.com
Post Reply