Count xbrowse records
Count xbrowse records
Hi, I have a xbrowse:
Lista40:cAlias := "ARQANO"
How I count records? I don't want the deleted ones to enter the sum.
Thanks!
Lista40:cAlias := "ARQANO"
How I count records? I don't want the deleted ones to enter the sum.
Thanks!
- Silvio.Falconi
- Posts: 7134
- Joined: Thu Oct 18, 2012 7:17 pm
- Been thanked: 1 time
Re: Count xbrowse records
perhaps
len(oBrw:aArrayData )
or
oBrw:nDataRows
len(oBrw:aArrayData )
or
oBrw:nDataRows
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
- nageswaragunupudi
- Posts: 10721
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Been thanked: 8 times
- Contact:
Re: Count xbrowse records
With or without XBrowse, we need to know the number of records in a DBF which are not deleted.
There is no simple function for this.
Does not matter whether SET DELETED is ON or OFF:
Both LASTREC() and RECCOUNT() include deleted records also.
ORDKEYCOUNT() also does not exclude deleted records by itself, but honors filters, scopes and index expressions.
So,
1)
2)
3)
There is no simple function for this.
Does not matter whether SET DELETED is ON or OFF:
Both LASTREC() and RECCOUNT() include deleted records also.
ORDKEYCOUNT() also does not exclude deleted records by itself, but honors filters, scopes and index expressions.
So,
1)
Code: Select all | Expand
SET FILTER TO !DELETED()
? OrdKeyCount()
Code: Select all | Expand
INDEX ON RECNO() TAG RECS FOR !DELETED() // keep this index tag also
// then
? OrdKeyCount( "RECS" )
Code: Select all | Expand
INDEX ON RECNO() TAG DELS FOR DELETED() // kee this index tag also
? OrdKeyCount(0) - OrdKeyCount( "DELS" )
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
- Silvio.Falconi
- Posts: 7134
- Joined: Thu Oct 18, 2012 7:17 pm
- Been thanked: 1 time
Re: Count xbrowse records
nageswaragunupudi wrote:With or without XBrowse, we need to know the number of records in a DBF which are not deleted.
There is no simple function for this.
Does not matter whether SET DELETED is ON or OFF:
Both LASTREC() and RECCOUNT() include deleted records also.
ORDKEYCOUNT() also does not exclude deleted records by itself, but honors filters, scopes and index expressions.
So,
1)2)Code: Select all | Expand
SET FILTER TO !DELETED() ? OrdKeyCount()
3)Code: Select all | Expand
INDEX ON RECNO() TAG RECS FOR !DELETED() // keep this index tag also // then ? OrdKeyCount( "RECS" )
Code: Select all | Expand
INDEX ON RECNO() TAG DELS FOR DELETED() // kee this index tag also ? OrdKeyCount(0) - OrdKeyCount( "DELS" )
Nages,
is there a function in Xbrowse to calculate how many records are visible in xbrowse?
I explain to you:
at the bottom of the Xbrowse I want to insert two buttons to move the records and I want them to be activated only if the record count exceeds the actual display of the Xbrowse
Code: Select all | Expand
@ 148, 320 BTNBMP aBtnBrow[1] ;
RESOURCE "DWN_TBL", "", hBmp, "" ;
SIZE 15, 13 PIXEL FLAT NOROUND GDIP WHEN lArrows OF oDlg ;
ACTION oBrw:KeyDown(VK_UP, 0)
@ 148, 335 BTNBMP BTNBMP aBtnBrow[2] ;
RESOURCE "UP_TBL", "", hBmp1, "" ;
SIZE 15, 13 PIXEL FLAT NOROUND GDIP WHEN lArrows OF oDlg ;
ACTION oBrw:KeyDown(VK_DOWN, 0)
the lArrows must be true
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Re: Count xbrowse records
Thank you!Silvio.Falconi wrote:perhaps
len(oBrw:aArrayData )
or
oBrw:nDataRows
Re: Count xbrowse records
Mr Nages thank you! I solved it by adding the !deleted() in indexnageswaragunupudi wrote:With or without XBrowse, we need to know the number of records in a DBF which are not deleted.
There is no simple function for this.
Does not matter whether SET DELETED is ON or OFF:
Both LASTREC() and RECCOUNT() include deleted records also.
ORDKEYCOUNT() also does not exclude deleted records by itself, but honors filters, scopes and index expressions.
So,
1)2)Code: Select all | Expand
SET FILTER TO !DELETED() ? OrdKeyCount()
3)Code: Select all | Expand
INDEX ON RECNO() TAG RECS FOR !DELETED() // keep this index tag also // then ? OrdKeyCount( "RECS" )
Code: Select all | Expand
INDEX ON RECNO() TAG DELS FOR DELETED() // kee this index tag also ? OrdKeyCount(0) - OrdKeyCount( "DELS" )