More than one 'Range Limit Field' 
Author Message
 More than one 'Range Limit Field'

Hello, I have a question about Clarion for Windows.

Is there a way to use more than one 'Range limit field' in a browse
with a multiple component-key.

My key:       WOR:Department
                     WOR:OK
                     WOR:Date
                     WOR:Time

I want to filter the list on Department and on Ok and then on
Date, without using the Record filter because it slows down the
search enormously.

So is there a template for a browse that can do this (can't be
that difficult!)

Ramon van de Laar




Sun, 05 Sep 1999 03:00:00 GMT  
 More than one 'Range Limit Field'

Hi

Quote:

> Is there a way to use more than one 'Range limit field' in a browse
> with a multiple component-key.

> My key:       WOR:Department
>                      WOR:OK
>                      WOR:Date
>                      WOR:Time

> I want to filter the list on Department and on Ok and then on
> Date, without using the Record filter because it slows down the
> search enormously.

Set your range limit field to WOR:Date as if it were the only field in the
key. At procedure setup set WOR:Department = Whatever and WOR:OK = True
(False)

Using the range limit like this it uses the range limit you have set and
takes the CURRENT VALUE of any fields higher up in the key

HTH

Sean Gates
Gates Computer Systems

http://www.tradepage.co.za/gcs



Sun, 05 Sep 1999 03:00:00 GMT  
 More than one 'Range Limit Field'

Quote:
> Is there a way to use more than one 'Range limit field' in a browse
> with a multiple component-key.

> My key:       WOR:Department
>                      WOR:OK
>                      WOR:Date
>                      WOR:Time
> Ramon van de Laar

Hi Ramon

I am sending a reply that I sent to someone some time ago. Hope it
helps. Feel free to ask again if you still have problems.

Assume you have a key with four fields: Pre:Field1, Pre:Field2,
Pre:Field3, Pre:Field4
Assume you want a range limit with high and low values on Field3.

Case 1 : List Box without Tabs
^^^^^^^^
Declare two local variables, Loc:Field3Lo and Loc:Field3Hi
In actions, declare the range limit on Field3, Range of Values, using
the above two local variables

Then on the window populate the following four fields
Pre:Field1  Pre:Field2  Loc:Field3Lo  Loc:Field3Hi

Now select the properties of Pre:Field1. The use variable is
?Pre:Field1   Change the use variable to ?Brw1::Sort1:Save:Pre:Field1
Change the use variable for Field2 to ?Brw1::Sort1:Save:Pre:Field2
(The Brw1 could be Brw2 or Brw3 in your code)

For both Field1 and Field2 embed the following code on Accepted,
After           ForceRefresh = True
                Do Refresh Window

That's it.

Case 2 : List Box with Tabs
^^^^^^^^
This can get very tricky. I have some that work great, others that
don't work that well (eg I have to click on another field before
the list refreshes)

Assume that there are three tabs, each with its own key. The key in
Case 1 above is the 'primary' key, as declared on the files button on
the procedure properties window.

The CW code now does the following:
Tab1   Brw1::SortOrder = 2
Tab2   Brw1::SortOrder = 3
Tab3   Brw1::SortOrder = 1
(the last tab is always Brw1::SortOrder = 1)

Declare two more local variables, Loc:Field1 and Loc:Field2
Populate 4 entry fields Loc:Field1, Loc:Field2, Loc:Field3Lo and
Loc:Field3Hi

On Loc:Field1, add the following Embed code on Accepted, BEFORE
     Case Brw1::SortOrder
       Of 1
          some code
       Of 2
          some code
       Of 3                      ! This is the first tab
          ?Brw1::Sort3:Save:Pre:Field1 = Loc:Field1
          ?Brw1::Sort3:Save:Pre:Field2 = Loc:Field2
     End ! Case      ^
(NB Note the Sort3)

And on Accepted, After    ForceRefresh = True
                          Do RefreshWindow

Similar code for Loc:Field2

I have found that sometimes the Do RefreshWindow doesn't work. It
will work on one tab and not on another. I haven't yet figured out
why.

Also, it is sometimes necessary to ForceRefresh etc on some range
limit fields (Loc:Field3 in this example). I start without it and
then add it if it does not work. I also haven't figured this one out
yet.

Hope this gets you going.
It took me a while to understand the code (sort of), but I can now
implement this very quickly.

Regards
Malcolm



Mon, 06 Sep 1999 03:00:00 GMT  
 More than one 'Range Limit Field'


Quote:
>Hello, I have a question about Clarion for Windows.

>Is there a way to use more than one 'Range limit field' in a browse
>with a multiple component-key.

>My key:       WOR:Department
>                     WOR:OK
>                     WOR:Date
>                     WOR:Time

>I want to filter the list on Department and on Ok and then on
>Date, without using the Record filter because it slows down the
>search enormously.

>So is there a template for a browse that can do this (can't be
>that difficult!)

It it rather difficult if the underlying DBMS doesn't support clever
index-filters.
MS-FoxPro and MS-Access have clever indexes (I believe it's called Rushmore
or Rutherfield or something).

If WOR:OK is a True/False-field, make that the first part of the/a(nother)
key.
Use that key for the browse when the "filter" includes the OK-field.
Because it's the first field, it is "strong".
And use Record Selector, if that is still around (it is in CPD2).

In MS-Access, I construct the SQL-string myself by parsing which
filter-fields have a value.
This works very well and is fast. You might be able to do something similar
as follows:

- create a key-less temporary file with only the record-numbers
  of the records that belong to the sub-set as defined by the filter
- use this file as the "master"-file for the browse

But in multi-user-situations this might cause problems,
because the temp-file is a "snapshot", not a "dynaset".

I know more tricks. Just ask.

------------------------------------------------------------------
|  Ruud H.G. van Tol      |  ISOLUTION B.V. |  At Data'dam they  |
|  fax +31 (0)20 4282001  |  AMSTERDAM      |  call me Dr.Ruud   |
------------------------------------------------------------------
   Poetry doesn't belong to who wrote it, but to who needs it.
   http://www.xs4all.nl/~rvtol/



Mon, 06 Sep 1999 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. More than one 'Range Limit Field' -Reply

2. How To Do Variable 'Range Limit'

3. Range limit doesn't work on SQL

4. how to use 5 range limits field's or many filtre's in browse in cw ....dejan_d@EUnet.yu.

5. Locator on Browse with Range limit : 'RANGE OF VALUES'

6. Range limit field

7. Multiple-fields key and range limits

8. Browse range-limit field

9. two range limit fields

10. More range limit fields?

11. Multi-Field Range Limit

12. Browse Range Limit, multi-field key?

 

 
Powered by phpBB® Forum Software