Page 1 of 1
Add / Remove FILTER from existing DBFILTER()
Posted: Wed Aug 10, 2022 6:34 pm
by AUGE_OHR
hi,
guess i have use
Code: Select all
SET FILTER TO FIELD->AAA = "ABC" .AND. FIELD->BBB = "EFG"
and i want to "add" more ... how under HMG
also how to "remove" Part of DBFOLTER()

Re: Add / Remove FILTER from existing DBFILTER()
Posted: Wed Aug 10, 2022 6:49 pm
by mol
If you want to add something new:
cNewFilter := dbFilter() + ".and." + cExpression
Set Filter to
set filter to cNewFilter
you can use dbClearFilter() instead of SET FILTER TO
for changing something, the best way is removing defined filter and defining it again, in my opinion.
Re: Add / Remove FILTER from existing DBFILTER()
Posted: Wed Aug 10, 2022 10:48 pm
by AUGE_OHR
hi Mol,
mol wrote: ↑Wed Aug 10, 2022 6:49 pm
Code: Select all
cNewFilter := dbFilter() + ".and." + cExpression
Set Filter to
set filter to cNewFilter
hm ... DBFLTER() return String not Codebock as i expect
for changing something, the best way is removing defined filter and defining it again, in my opinion.
you are right, it is (much) more work to "remove" a Part than create a New FILTER
Re: Add / Remove FILTER from existing DBFILTER()
Posted: Thu Aug 11, 2022 6:55 am
by serge_girard
Jimmy,
Maybe this works:
Code: Select all
cNewFilter := dbFilter() + ".and." + &cExpression
or this
cNewFilter := dbFilter() + .and. + &cExpression
Serge
Re: Add / Remove FILTER from existing DBFILTER()
Posted: Thu Aug 11, 2022 1:07 pm
by mol
If you have filter expression from dbFilter(), you can easy change it codeblock:
Code: Select all
cNewFilter := "{||" + dbFilter() +".and." + cExpresion +"}"
bNewFilter := &cNewFilter