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?
oBrw:KeyCount() inexacto (SOLUCIONADO)
- RodolfoRBG
- Posts: 253
- Joined: Tue May 16, 2006 4:46 pm
- Location: San Luis Potosi, SLP, Mexico
- Contact:
oBrw:KeyCount() inexacto (SOLUCIONADO)
Last edited by RodolfoRBG on Fri May 22, 2015 2:47 pm, edited 1 time in total.
- nageswaragunupudi
- Posts: 8017
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
Re: oBrw:KeyCount() inexacto
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().
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
G. N. Rao.
Hyderabad, India
- RodolfoRBG
- Posts: 253
- Joined: Tue May 16, 2006 4:46 pm
- Location: San Luis Potosi, SLP, Mexico
- Contact:
Re: oBrw:KeyCount() inexacto (RESUELTO)
Now it works! Thanks!!!