filter question

This forum is for general support of Xbase++
Post Reply
Message
Author
BruceN
Posts: 280
Joined: Thu Jan 28, 2010 7:46 am
Location: Slidell, LA

filter question

#1 Post 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.
There are only 10 kinds of people - those who understand binary and those who don't :)

User avatar
Tom
Posts: 1205
Joined: Thu Jan 28, 2010 12:59 am
Location: Berlin, Germany

Re: filter question

#2 Post by Tom »

Hi, Bruce.

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

"Did I offend you?"
"No."
"Okay, give me a second chance."

skiman
Posts: 1195
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: filter question

#3 Post 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"
...
Best regards,

Chris.
www.aboservice.be

BruceN
Posts: 280
Joined: Thu Jan 28, 2010 7:46 am
Location: Slidell, LA

Re: filter question

#4 Post by BruceN »

dbfilter did EXACTLY what I wanted - thanks
There are only 10 kinds of people - those who understand binary and those who don't :)

Post Reply