FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour TXBrowse - Refresh() - Some Issues
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
TXBrowse - Refresh() - Some Issues
Posted: Sat Jan 12, 2008 03:20 AM
When a field of the current row in the active index is modified, if the new OrdKeyNo() is less than the oBrw:nRowSel, the browse display is incorrect even after oBrw:Refresh().

I assume this does not require any examples, because this must be of common experience or can be easily comprehended.

The work around is
if ( n := OrdkeyNo() ) < oBrw:nRowSel
oBrw:nRowSel := n
oBrw:Refresh()
endif

But programmers who face this situation for the first time should learn this work around either by trial and error or from some posting in these forums. Instead why can not the Refresh method be modified slightly?


Instead of the present
    ::nRowSel  := Min(::nRowSel, ::nLen)
Substitute:
    ::nRowSel	:= Min(::nRowSel,  eval( ::bKeyNo ) )


This modification resolves this issue totally for every kind of data source.
Regards



G. N. Rao.

Hyderabad, India
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
TXBrowse - Refresh() - Some Issues
Posted: Sat Jan 12, 2008 03:25 AM

This also resolves display issues when changing index order or seek a value less than the present key value.

Regards



G. N. Rao.

Hyderabad, India
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
TXBrowse - Refresh() - Some Issues
Posted: Sat Jan 12, 2008 07:21 AM

NageswaraRao,

Fixed. many thanks! :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
TXBrowse - Refresh() - Some Issues
Posted: Sat Jan 12, 2008 07:57 AM

NageswaraRao,

Isn't using bKeyNo going to cause a real slowdown when used with ADS?

James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
TXBrowse - Refresh() - Some Issues
Posted: Sat Jan 12, 2008 08:38 AM

1) Evaluation of bKeyNo does take a triffle more time. But what we dont realize is that bKeyNo keeps on getting evaluated by the xbrowse object on many occasions without our knowledge. Exampes: When bookmarks are saved, vertical scroll is operated and so on. So most of the times this extra time is not noticeable.

2) We do not use Refresh() everytime. The question is once in a while when we need a refresh, is this little extra time worth or not?

3) It is true that AdsKeyNo() does take more time. In some circumstances the time it takes can be prohibitive too. But xbrowse does not use AdsKeyNo(). Instead it uses AdsGetRelKeyPos and AdsSetRelKeyPos functions which are faster versions though approximate. Even on large tables the performance is not bad. ( My experience is with tables contation more than 500,000 rows with complex serverside filters and more than 100 users at any time).

4) Still it has to be accepted that the suggested change to Refresh method does make it slow but is it going to be perceptible when anyway bKeyNo is getting evaluated so many times even otherwise?

Regards



G. N. Rao.

Hyderabad, India
Posts: 167
Joined: Thu Mar 22, 2007 11:24 AM
TXBrowse - Refresh() - Some Issues
Posted: Sat Jan 12, 2008 09:30 AM
Now i see in the source :

::nRowSel  := Min(::nRowSel, ::nLen)
::nArrayAt := Min(::nArrayAt, ::nLen)


I try to use xbroxse so much as possible with arrays , eval(::bKeyno) gives ::nArrayAt , so i suppose it must be changed in

::nArrayAt := Min(::nArrayAt, ::nLen)
::nRowSel  := Min(::nRowSel, Eval(::bKeyNo))


Frank

Continue the discussion