Jump to content

Range finding - anything faster?


panchristo

This topic is 4986 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Hi all.

I have a table where filenames of photos are stored.

The filenames go by the following pattern:

MP_Vol##_p###(###-###).jpg

This is because they are scans of an old inventory book, where the # in the parentheses represent the inventory serial numbers included in a page(p###) of a certain Volume(Vol###).

Once the filename is stored in the table, I use calculation fields to "capture" separately the range of inventory items of each page.

In order to have a quickfind (search-as-you-type) functionality, I have included a global FILTER field (placed in the header), where the user can either enter a single number or a range.

Using a OnModify script trigger, I have a script which:

1. enters find mode

2. recognizes if there is a range typed,

3. enters a request creation loop,

4. enters the $FromNumber into the FromnumberCALC field as: ≤ $FromNumber and

5. then on the same request, SetField[ToNumberCALC]: ≥ $fromnumber

6. Increments the $FromNumber variable +1,

7. Loops or Exits the Loop if $FromNumber > $ToNumber

8. Performs the find and exits.

My problem is that when i enter a range such as 10-1000, it takes around 40sec to create all the needed requests.

All I am asking is:

1. Is my methodology correct?

2. Is there another more effective way for implementing this?

3. I would like all of this to work in a list-view layout, but could it be that this is the root of the problem?

Link to comment
Share on other sites

Do you want to find any record that partially overlaps the requested range, or only records that contain the entire range?

There are two cases:

1. I am looking for a specific number

2. I am looking for a range of numbers

In both cases though, the numbers are not the exact From-To of the range included in the page.

Here's an example:

ObjectNo

pgNo From To

1 | 1 - 3

2 | 3 - 3 (in case page contains only one)

3 | 3 - 5

4 | 5 - 10

5 | 10 - 11

I may be looking for:

1. Object No2, as well as,

2. Objects 2-6

Where I would need to be shown:

1. page 1, or

2. pages 1,2,3,4

as results respectively

Link to comment
Share on other sites

Actually, there is only one case - because in the first example you are looking for a range from 2 to 2 (inclusive).

Try a single request to find records where:

StartPage ≤ $rangeEnd

AND

EndPage ≥ $rangeStart

Seems to work, don;t know why I didn't think of it sooner... :blush2: :crazy2:

Link to comment
Share on other sites

This topic is 4986 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.