Home > Archive > Getting Started with dBASE > October 2006 > Re: Can I use a varible to set the filter?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: Can I use a varible to set the filter?
Gerald Lightsey

2006-10-25, 7:23 am

On Tue, 19 Sep 2006 20:37:55 -0500, in the dbase.getting-started group,
Forrest Ganther said...
> I want to use a variable as the filter criteria,
> but I can't figure out how. Even Ken's book
> doesn't address that. Is it possible?
>
> If not how can I work around?


What follows is from on-line help for SET FILTER. Keep in mind that
macro substitution itself requires a private or public variable so
fundamentally scope is the issue.

Gerald

Note
You cannot use the special variables this or form in the <condition>.
This is explicitly prohibited because these special variables
automatically take on the value of whatever object and form has focus
(or fires an event) at any given moment. Therefore, the filter condition
will vary and quite likely be invalid. Generally speaking, you should
not use variables in a filter condition at all, because the variables
may go out of scope, making the filter condition an invalid expression.
To solve these problems, use macro substitution, as shown in the
example.
Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com