xBrowse

Re: xBrowse

Postby nageswaragunupudi » Thu Sep 15, 2011 4:32 am

A note on "SET FILTER TO !DELETED()".

This does not slow down the navigation, if proper care is taken. (Applies to DBFCDX and ADSCDX). On the contrary this will greatly improve the speed in case the DBF contains lots of deleted records.

Important:
Create one tag compulsorily on all medium and large tables on DELETED().'
Example: INDEX ON DELETED() TAG DELETED.

Instead of clearing filter
SET FILTER TO !DELETED()
For setting a filter:
SET FILTER TO <condition> .AND. !DELETED().

Performance will considerably improve on DBFs having many deleted records.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10631
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: xBrowse

Postby nageswaragunupudi » Thu Sep 15, 2011 4:34 am

Bayron wrote:Thanks for your answer, I do use basicly the same logic, but as I said before
The problem is not about the Deleted Records, but is that when I delete a record, the color of that row is lost and I get two consecutive rows with the same color....As you can see the above picture...


I think the problem is with the painting, when I use oBrw:Refresh() :bClrStd is not Evaluated and Repainted again...

I am just going to set the browse records on a single color... to avoid all of the trouble...


NOT AT ALL.
I prepared the sample to show you that the alternating colors are painted correctly after deleting records. You see my sample. Works PERFECTLY.
If it is not working for you, please recheck your code.

Note: Hope you are using DBFCDX
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10631
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: xBrowse

Postby Bayron » Thu Sep 15, 2011 4:53 am

That should be my problem... I am not using Indexes...

I'm sorry, for the misunderstanding, I only mentionated it on the first post!!!

I'll try with indexes...
=====>

Bayron Landaverry
(215)2226600 Philadelphia,PA, USA
+(502)46727275 Guatemala
MayaBuilders@gMail.com

FWH12.04||Harbour 3.2.0 (18754)||BCC6.5||UEstudio 10.10||
Windows 7 Ultimate

FiveWin, One line of code and it's done...
User avatar
Bayron
 
Posts: 815
Joined: Thu Dec 24, 2009 12:46 am
Location: Philadelphia, PA

Re: xBrowse

Postby Bayron » Thu Sep 15, 2011 5:22 am

Mr. Rao,

I Tested your Sample, and It work's as expected...

I am testing to see how I can apply this to my case, because I am using the browse to add items that do not need sorting, because it's a receipt...

If I use a blank field to index, should the Index leave the order as is????
=====>

Bayron Landaverry
(215)2226600 Philadelphia,PA, USA
+(502)46727275 Guatemala
MayaBuilders@gMail.com

FWH12.04||Harbour 3.2.0 (18754)||BCC6.5||UEstudio 10.10||
Windows 7 Ultimate

FiveWin, One line of code and it's done...
User avatar
Bayron
 
Posts: 815
Joined: Thu Dec 24, 2009 12:46 am
Location: Philadelphia, PA

Re: xBrowse

Postby nageswaragunupudi » Thu Sep 15, 2011 8:39 am

The sample I give works perfectly whether there is any index or not.
But does not work with DBFNTX.

Now I understand that you must be using DBFNTX. If you use DBFCDX, it works as expected, with or without index/

If for some reason you have to use DBFNTX, please keep in mind that you may not be able to avail certain features like this.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10631
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: xBrowse

Postby Bayron » Thu Sep 15, 2011 1:05 pm

Mr. Rao,

Yes, I Confirm it now, It works with and without Indexes as long as the VIA "DBFCDX" is included when openning the database even if no index is created and used...and the other commands are included:

Code: Select all  Expand view
REQUEST DBFCDX
....
SET DELETED ON
....
....

SET FILTER TO !DELETED()
 


Thanks for your patience and concise expanations!!!

It is for your very well explanated answers that we can unsderstand how easy it's to use the very complex right use of the powerfull xbrowse...
=====>

Bayron Landaverry
(215)2226600 Philadelphia,PA, USA
+(502)46727275 Guatemala
MayaBuilders@gMail.com

FWH12.04||Harbour 3.2.0 (18754)||BCC6.5||UEstudio 10.10||
Windows 7 Ultimate

FiveWin, One line of code and it's done...
User avatar
Bayron
 
Posts: 815
Joined: Thu Dec 24, 2009 12:46 am
Location: Philadelphia, PA

Re: xBrowse

Postby stefano » Thu Sep 15, 2011 8:47 pm

to color lines in a browser, try:
Code: Select all  Expand view

    // Setup alternating row flag
   lClrFlag:=.f.
   olbx1:bSkip:={| nRecs | ( if(nRecs == nil, nRecs := 1,),nRecs:= arccod->(dbskipper( nRecs )), lClrFlag:= if( nRecs % 2 = 0, lClrFlag,!lClrFlag), nRecs) }

   // Define alternating row colors
   olbx1:bClrStd:= {|| if(lClrFlag,{ CLR_BLACK, RGB(196,226,255)},{ CLR_BLACK, RGB(221,245,255) }) }
 


works both with a set filter to .... and with record delete
I do not remember where I found this code ... perhaps tsbrowse ???

arccod -- name archive

Ciao
Stefano
FWH 14.11 + xHarbour + bcc582
stefano
 
Posts: 80
Joined: Tue Mar 25, 2008 9:03 pm
Location: ITALIA

Re: xBrowse

Postby nageswaragunupudi » Thu Sep 15, 2011 11:44 pm

Yes, Mr. Stefano's solution works in all cases.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10631
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Previous

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 118 guests