| pblais@odstrategies.org 2006-06-28, 7:56 am |
| On 27 Jun 2006 13:43:59 -0400, "Gary Stephens" <gsslug@hotmail.com>
wrote:
>Problem solved. I used the "Hot Field" tab to bind the variables. I removed
>them from there and did the binding in an embed. Now it works.
Alternatively what I do when I need complex filters made on the fly is
place all the screen variables where you want. Then add all the
variables to the RESET fields not the hot filed's. they don't need to
be in the queue (maybe they do but that is not required). Then go to
the BRWx.ApplyFilter method and construct a filter string on the fly
to CSTRING. Resolve all the screen variables to literal values
instead of binding them. Optimize the code so the filter has no
redundant logic then:
SELF.SetFilter(Your_CString_Filter,1)
Note: SetFilter supports a filter ID number. Often the code is easier
if you make many small filters. Init them all to blanks then set the
ones you need. The string building logic gets much easier to read and
the separate filter strings are like an 'AND'.
Since all the screen controls are lost as reset fields any time any of
them change the ABC methods will call .ApplyFilter. All your filter
logic is in one place alone. You can eliminate all binding. Binding
can be a lazy approach that takes more code and makes slow filters.
Since switching to this approach I have screens with 10 or more
controls that the user can set on the browse for lots of purposes that
all generate a filter. Writing good filters and tossing them to the
ABC ViewManger results in an overall fast view for most applications
SQL or ISAM.
Personally I find it easier to do it this way than to try and fit
large filter expressions into the single filter string of the browse
Action properties window, it eliminates BIND, and reduces the Queue by
not adding queue records for the Hot Fields if you don't really want
to display. You now can write as many lines as required to build an
optimized filter string.
If you would like an example I have one that makes 7 filter strings I
could send you.
---------------------------------------
Paul Blais - Hayes, Virginia
|