On Tue, May 14, 2019 at 6:46 PM Gene Wirchenko gene@shaw.ca wrote:
use cwkf set filter to validto>={^2019.01.01} count browse I do know that I can do f=filter()+" and empty(wfccccd)" set filter to &fbut in the heat of debugging, I would prefer just one statement.
Is there a way to extend a filter in one statement withoutretyping the current filter expression?
No, SET FILTER is an ancient command that doesn't seem to accept anything other than the literal expression inline. Your two-line macro expansion is likely the fastest and simplest.
But there are lots of workarounds: 1. Add the filter on to the commands: count for empty(wfccccd) browse for empty(wfccccd) 2. Use SQL: SELECT Count(*) FROM cwkf WHERE EVALUATE(FILTER("cwkf")) AND empty(wfccccd) SELECT * FROM cwkf WHERE EVALUATE(FILTER("cwkf")) AND empty(wfccccd) 3. Up-arrow twice and add the filter expression to the end of the filter. ;)
I realize I am not a VFP guy, but would the following not work? In Clipper/VO this will work.
set filter to &(filter() + " and empty(wfccccd)")
On 2019/05/15 01:43, Ted Roche wrote:
On Tue, May 14, 2019 at 6:46 PM Gene Wirchenko gene@shaw.ca wrote:
use cwkf set filter to validto>={^2019.01.01} count browse I do know that I can do f=filter()+" and empty(wfccccd)" set filter to &fbut in the heat of debugging, I would prefer just one statement.
Is there a way to extend a filter in one statement withoutretyping the current filter expression?
No, SET FILTER is an ancient command that doesn't seem to accept anything other than the literal expression inline. Your two-line macro expansion is likely the fastest and simplest.
But there are lots of workarounds:
- Add the filter on to the commands:
count for empty(wfccccd) browse for empty(wfccccd) 2. Use SQL: SELECT Count(*) FROM cwkf WHERE EVALUATE(FILTER("cwkf")) AND empty(wfccccd) SELECT * FROM cwkf WHERE EVALUATE(FILTER("cwkf")) AND empty(wfccccd) 3. Up-arrow twice and add the filter expression to the end of the filter. ;)
Hi, The use of 'Set Filter' in VFP is outdated. Nowadays we use Select....from...Where...into Regards, Koen
Op wo 15 mei 2019 om 10:55 schreef Johan Nel johan.nel@xsinet.co.za:
I realize I am not a VFP guy, but would the following not work? In Clipper/VO this will work.
set filter to &(filter() + " and empty(wfccccd)")
On 2019/05/15 01:43, Ted Roche wrote:
On Tue, May 14, 2019 at 6:46 PM Gene Wirchenko gene@shaw.ca wrote:
use cwkf set filter to validto>={^2019.01.01} count browse I do know that I can do f=filter()+" and empty(wfccccd)" set filter to &fbut in the heat of debugging, I would prefer just one statement.
Is there a way to extend a filter in one statement withoutretyping the current filter expression?
No, SET FILTER is an ancient command that doesn't seem to accept anything other than the literal expression inline. Your two-line macro expansion
is
likely the fastest and simplest.
But there are lots of workarounds:
- Add the filter on to the commands:
count for empty(wfccccd) browse for empty(wfccccd) 2. Use SQL: SELECT Count(*) FROM cwkf WHERE EVALUATE(FILTER("cwkf")) AND
empty(wfccccd)
SELECT * FROM cwkf WHERE EVALUATE(FILTER("cwkf")) AND empty(wfccccd) 3. Up-arrow twice and add the filter expression to the end of the
filter. ;)
[excessive quoting removed by server]
On 15/05/2019 10:00, Koen Piller wrote:
Hi, The use of 'Set Filter' in VFP is outdated. Nowadays we use Select....from...Where...into Regards, Koen
Hey, leave my set filter alone... :-) I have found a few uses for it that work brilliantly and I couldn't think of an alternative. Things like cleaning up name/address data. You would set filter to empty(postcode) say and browse. I would set up macros to cut/paste from one field to another that would fill in the postcode from another field and it would disappear from view. It works well on small data sets but becomes too slow to evaluate for larger ones.
my .02
Peter
This communication is intended for the person or organisation to whom it is addressed. The contents are confidential and may be protected in law. Unauthorised use, copying or disclosure of any of it may be unlawful. If you have received this message in error, please notify us immediately by telephone or email.
www.whisperingsmith.com
Whispering Smith Ltd Head Office:61 Great Ducie Street, Manchester M3 1RR. Tel:0161 831 3700 Fax:0161 831 3715
London Office: 101 St. Martin's Lane,London, WC2N 4AZ Tel:0207 299 7960
Yes, SET FILTER always need to use macro substitution &filter_expr! Using SQL is also a better solution usually, depending how you move the record pointer.
On Wed, May 15, 2019 at 4:55 PM Johan Nel johan.nel@xsinet.co.za wrote:
I realize I am not a VFP guy, but would the following not work? In Clipper/VO this will work.
set filter to &(filter() + " and empty(wfccccd)")