List cull?

Oct 25, 2013 at 5:26pm

List cull?

So – I’ve been tearing my hair out a little on this one…

Say I have two integers which are dynamic, a maximum and minimum. Let’s say 9 and 12.

I also have a list of values, running from index 0 – 64, which are also dynamic.

Basically, I want to extract the indexes 9, 10, 11 and 12 from the list. I know this must have a simple solution but the list objects are running me around in circles…

Thanks for your time!

- Rich

#269165
Oct 25, 2013 at 7:37pm

Many ways to do that. Here’s one.
<code>

– Pasted Max Patch, click to expand. –

</code>

#269166
Oct 26, 2013 at 2:27am

Woop! Thanks I think ‘iter’ was the missing piece of the puzzle!

- Rich

#269177
Oct 26, 2013 at 8:41am

Or here’s another.
<code>

– Pasted Max Patch, click to expand. –

</code>

#269194
Oct 26, 2013 at 8:57am

I misread your original question, thinking you were looking to extract the values 9 through 12 rather than indices 9 through 12. To get specific indices, you probably want to use [zl lookup].
<code>

– Pasted Max Patch, click to expand. –

</code>

#269195
Oct 28, 2013 at 2:48pm

Cheers Christopher!

- Rich

#269413
Oct 31, 2013 at 10:26am

I do have another question actually if you have any time – and that’s do you know of an object that will create a range running between a max and min, or does this have to be constructed using a series of objects…Say – if I were to input 4 and 9, it would output a series of integers 4, 5, 6, 7, 8, 9?

Cheers,

- Rich

#269768
Oct 31, 2013 at 10:13pm

No such object that I know of. Ya just roll yer own.
<code>

– Pasted Max Patch, click to expand. –

</code>

#269812
Nov 5, 2013 at 12:44pm

Well nicely ‘rolled’ then – works like a charm dude thanks…

- Rich

#270246

You must be logged in to reply to this topic.