Filter/Scope dilemna

Filter/Scope dilemna

Postby Greg Gammon » Tue Sep 04, 2007 1:20 pm

I need some ideas on how to accomplish a multiple filter that will work fast. I have four separate browses in a window with different filters working from the same database ...and the filter will change dynamically based on user input also.

SET FILTER TO UPPER(jobdate1->status) != "COMPLETE" .AND. jobdate1->scheddate = dDate1 .AND. jobdate1->presscode = cPressCode

Obviously FILTER is SLoooowwwww. It can take upwards of 4-5 seconds to paint the screen or change the view.

Are there any techniques to accomplish this that will be faster?

I was experimenting with a combination of FILTER and SET SCOPE, but couldn't even get the SET SCOPE beyond a compiler error ("parse error at SCOPE".... SET SCOPE TO dDate1...indexed on date).

Ideas are appreciated! Thanks.... Greg
User avatar
Greg Gammon
 
Posts: 105
Joined: Fri Jun 09, 2006 3:27 pm
Location: Bryan, Texas

Postby Rick Lipkin » Tue Sep 04, 2007 1:48 pm

Greg

Add #include "ord.ch" to the top of your .prg

Rick
User avatar
Rick Lipkin
 
Posts: 2666
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Postby Greg Gammon » Tue Sep 04, 2007 1:53 pm

Rick,
What does ord.ch accomplish? Is this to allow SET SCOPE?
G
User avatar
Greg Gammon
 
Posts: 105
Joined: Fri Jun 09, 2006 3:27 pm
Location: Bryan, Texas

Postby StefanHaupt » Tue Sep 04, 2007 2:22 pm

Greg,

create an index file with the filter you need for the browses and open the database in 4 different workareas and use the accompanying index tag in every workarea. So every browse can have its own scope.
kind regards
Stefan
StefanHaupt
 
Posts: 824
Joined: Thu Oct 13, 2005 7:39 am
Location: Germany

Postby Greg Gammon » Tue Sep 04, 2007 2:27 pm

Yes, that is essentially what I am doing. The problem with FILTER though is it must evaluate every record of the database so it is much slower than SCOPE...but SCOPE will allow for only one key evaluation...and I need three.

What I am contemplating is copying to a temp database based on two keys which and using SCOPE for the third key...but then when a record is changed, I have to go back and change it in the main database (goto recno() having recorded the recno in the temp database)...just not very elegant...searching for a better way.

Thanks for the help!
G
User avatar
Greg Gammon
 
Posts: 105
Joined: Fri Jun 09, 2006 3:27 pm
Location: Bryan, Texas

Postby Rick Lipkin » Tue Sep 04, 2007 3:12 pm

Greg

Ord.ch translates the Set Scope command.

RIck
User avatar
Rick Lipkin
 
Posts: 2666
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 63 guests