FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour records on xbrowse
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
records on xbrowse
Posted: Mon Mar 25, 2024 09:42 AM

I can Know how many records are on xbrowse ?

I explain

I would like to activate the arrows for moving the records (up and down) only when the records are greater than the normal number displayed in the xbrowse table

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 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
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: records on xbrowse
Posted: Mon Mar 25, 2024 12:11 PM
Regards



G. N. Rao.

Hyderabad, India
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: records on xbrowse
Posted: Tue Mar 26, 2024 09:13 AM
nageswaragunupudi wrote:oBrw:nLen

But in case of DBF, please see
https://forums.fivetechsupport.com/viewtopic.php?f=3&t=44259&p=268091&hilit=DELETED&sid=ff38ec55e29d34b39e3578311e2aeb8d#p268091


I want to have the exact number of pages displayed with the dimensions of the xbrowse and I need this to activate my buttons which you can see in the right corner under the xbrowse
to activate my buttons I make
Code (fw): Select all Collapse
....
:CreateFromCode()
 END
lArrows:= IIF( oBrw:nDataRows<oBrw:nLen,.t.,.f.)
but it not run because I have 0 and -4

how I can resolve it ?
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 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
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: records on xbrowse
Posted: Tue Mar 26, 2024 09:49 AM
oBrw:nLen and oBrw:nDataRows get their values after the first Refresh/paint of the browse.
Also oBrw:nDataRows changes when browse is resized.
Code (fw): Select all Collapse
DEFINE BUTTON/BTNBMP ..... (arrows)  ... WHEN ( oBrw:nDataRows >= oBrw:nLen )
would work
Regards



G. N. Rao.

Hyderabad, India
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: records on xbrowse
Posted: Tue Mar 26, 2024 11:20 AM
nageswaragunupudi wrote:oBrw:nLen and oBrw:nDataRows get their values after the first Refresh/paint of the browse.
Also oBrw:nDataRows changes when browse is resized.
Code (fw): Select all Collapse
DEFINE BUTTON/BTNBMP ..... (arrows)  ... WHEN ( oBrw:nDataRows >= oBrw:nLen )
would work

Not%20working

I made
Code (fw): Select all Collapse
@  oBrw:nbottom+2, oBrw:nWidth-86 BTNBMP    aBtn[ 5 ]   SIZE 30, 25 PIXEL OF oDlg FLAT GDIP NOROUND  ; //
        RESOURCE "GRID_BOTTOM", "", hBmp, "" ;
     ACTION  oBrw:KeyDown(VK_DOWN, 0)  TOOLTIP "avanti"  WHEN (  oBrw:nDataRows >= oBrw:nLen   )
     @  oBrw:nbottom+2, oBrw:nWidth-56 BTNBMP    aBtn[ 6 ]   SIZE 30, 25 PIXEL OF oDlg FLAT GDIP NOROUND  ; //
        RESOURCE "GRID_TOP", "", hBmp1, "" ;
     ACTION oBrw:KeyDown(VK_UP, 0)   TOOLTIP "indietro" WHEN ( oBrw:nDataRows >= oBrw:nLen  )
INIT





Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 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
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: records on xbrowse
Posted: Tue Mar 26, 2024 11:29 AM
perhaps I resolved with WHEN ( oBrw:nDataRows < oDbf:OrdKeyCount() )

init


after search
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 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
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: records on xbrowse
Posted: Tue Mar 26, 2024 12:43 PM
oDbf:OrdKeyCount() )
This works only for oDbf.
Using oBrw:nLen or oBrw:KeyCount() works for all datasources.
Regards



G. N. Rao.

Hyderabad, India
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: records on xbrowse
Posted: Tue Mar 26, 2024 12:49 PM
nageswaragunupudi wrote:
oDbf:OrdKeyCount() )
This works only for oDbf.
Using oBrw:nLen or oBrw:KeyCount() works for all datasources.
ok but the button are not refreshed , only when I move the mouse into obrw

for a sample
WHEN ( oBrw:nDataRows <= oBrw:nLen ) not work
WHEN ( oBrw:nDataRows >= oBrw:nLen ) not work


oBrw:nDataRows <= oBrw:nLen - Not working



oBrw:nDataRows >= oBrw:nLen Here it works but in reverse

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 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
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: records on xbrowse
Posted: Wed Mar 27, 2024 09:20 AM

any solution please ?

the problem is when I make a search for a sample "frank" ( on First) ndatarow is 3 and also obrw:nlen is 3

I tried to inser a variable nTotalrecords at init

oDbf:= TCustomer():New()

oDbf:setorder(1)

oDbf:Gotop()

nTotalRecords:= oDbf:OrdKeyCount()

and the on each button

WHEN ( nTotalRecords > oBrw:nDataRows ) but it's wrong also

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 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

Continue the discussion