ranging lists

Dave LeYanna dleyanna at rtl.org
Wed Jan 29 08:28:01 EST 2003


Depending on the regular expression engine in rev 2, it is conceivable that 
one could go that route. BTW, I don't have the expertise to follow up on my 
suggestion, it's just a thought. I have a book from O'REILLY "Mastering 
Regular Expressions", maybe I should look into it.

djl

At 08:57 PM 1/29/03 +0900, you wrote:
>Hi
>
>Here's a challenge that I've been working on optimizing today and thought I
>would ask the list for help in making it good transcript.
>
>I have 2 lists. I need to check whether the values of list 2 fall within the
>range of the values of list 1. eg.
>
>list 1
>1 10
>20 25
>45 55
>
>list 2
>1,3,12,23,34,45,52,78
>
>List 1 may have up to 60 different ranges, one range per line.
>List 2 may have over 2000 items. (these are line numbers of a text database)
>
>I need to take item 1 of list 2 and see if it is > 1 and <10. If yes, then
>keep the item, if not, delete it. Then I need to take the next item of list
>2 and see if it falls within the range 1 10, and so on.
>
>Brute force can iterate each item of list 2 and compare it with each line of
>list 1 but I think it can be more elegant by noting when the item in line 2
>excedes the upper limit of the range and then move on to the next range. The
>faster the better.
>
>thanks for any suggestions on approaches, it doesn't have to be completed
>code.
>Ron
>
>_______________________________________________
>use-revolution mailing list
>use-revolution at lists.runrev.com
>http://lists.runrev.com/mailman/listinfo/use-revolution

======================
||   Dave LeYanna                 ||
||   Director IS                       ||
||   Right to Life of Michigan    ||
======================




More information about the use-livecode mailing list