Page 1 of 1

oBrw:KeyCount() inexacto (SOLUCIONADO)

Posted: Thu May 21, 2015 7:32 pm
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?

Re: oBrw:KeyCount() inexacto

Posted: Fri May 22, 2015 1:21 am
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().

Re: oBrw:KeyCount() inexacto (RESUELTO)

Posted: Fri May 22, 2015 2:46 pm
by RodolfoRBG
Now it works! Thanks!!!