in reply to Re: Stuck in my final step of code using array of arrays
in thread Stuck in my final step of code using array of arrays
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Stuck in my final step of code using array of arrays
by Anonymous Monk on Mar 04, 2014 at 01:47 UTC | |
One last question though: Suppose you have this list:
where there are codes not only before but also after the wanted one (PF03797). In this case the desired range would be between 351-1199 (350 is the end of the previous element and 1200 is the start of the next element). How can I take both of them? I tried the following without success
| [reply] [d/l] [select] |
by Cristoforo (Curate) on Mar 04, 2014 at 02:53 UTC | |
if($start=$i) and if($end=$i) Note how I wrote the line for my $start and my $end.
You could rewrite your code to be: The solution would be: The output from my code was: A0AWZ5 PF03797 351 1199 Hope this helps. | [reply] [d/l] [select] |
by kcott (Archbishop) on Mar 04, 2014 at 04:06 UTC | |
I think ++Cristoforo has provided the appropriate changes required (in Re^4: Stuck in my final step of code using array of arrays). Now that I see another example of input and expected output, I suspect 'none' is incorrect for either the start or the end of the range. I originally used this (in Re: Stuck in my final step of code using array of arrays) based on your description containing "... before and after them (if any) ..." in the OP. Here's another script, that uses virtually the same changes as Cristoforo supplied, but replaces 'none' with the values I think you want. I've included additional test data to cover the four cases with and without codes before and after the special code.
Output:
-- Ken | [reply] [d/l] [select] |
by Anonymous Monk on Mar 04, 2014 at 10:20 UTC | |
| [reply] |