Page 1 of 1

filter question

Posted: Fri Jan 21, 2011 7:42 am
by BruceN
Is there a way to test if a filter is active in a workarea? My thought is to have a hot key that toggles a filter on or off.

Re: filter question

Posted: Fri Jan 21, 2011 7:48 am
by Tom
Hi, Bruce.

DbFilter() returns an empty string if no filter is set or the filter condition if a filter is set.

Re: filter question

Posted: Fri Jan 21, 2011 8:08 am
by skiman
Hi,

I didn't test it, but according to the docs you have to specify it.

Code: Select all

DbSetFilter( <bFilter>, [<cFilter>] )
I'm using the cFilter parameter to define a value for the filter, I'm using it as a cargo.

In the docs there is mentioned that cFilter has to be the same logical expression as bFilter. This is not true, you can put other code in it.

For example:

Code: Select all

dbSetfilter( {|| Code block A} , "A" )
dbSetfilter( {|| Code block B} , "B" )
dbSetfilter( {|| Code block C} , "C" )
cFilter := dbfilter()
if cFilter == "A" 
...
elseif cFilter == "B"
...

Re: filter question

Posted: Sat Jan 22, 2011 8:47 am
by BruceN
dbfilter did EXACTLY what I wanted - thanks