Forums > MaxMSP

find unused index numbers in coll?

May 15, 2011 | 12:16 am

I have a patch here that I think should work, and it doesn’t. I have tried everything I can think of to debug it and I’m stumped. Is anyone up for a challenge? It might be easy if I’m missing something obvious!

– Pasted Max Patch, click to expand. –

May 15, 2011 | 6:29 am

The coll has items at index 1, 2 & 6, so the list you generate is 1 2 6. There is no match for 1 2 6 in the list you are sending to [zl sub]

May 15, 2011 | 8:46 am

i am also not sure, i understand what you are after, but recently i was in a situation, where i needed to know, which index in a coll had data associated with it. sounds a bit like the opposite of your problem, so maybe you can salvage some of my solution by reversing:

– Pasted Max Patch, click to expand. –

May 15, 2011 | 5:18 pm

The number of unused coll index numbers could be quite large. Do you really want to find holes within a range?

– Pasted Max Patch, click to expand. –

May 15, 2011 | 6:30 pm

Thanks so much, I was being a bit silly choosing zl sub instead of filter. What confused me even more was that I could send it a list like 1 2 3 4 from the coll output, and nothing would come out of zl sub, even though the identical list from a message would output the position matches. It was confusing.

I don’t think the large list problem would get out of control as long as the comparison list wasn’t huge either.

My intention here is to use the gap numbers to fill unused records in the same coll with placeholder data. I use this coll to label a bunch of textbuttons. If I don’t have placeholders, unused buttons retain old labels when data is updated.

Thanks for the input!

Viewing 5 posts - 1 through 5 (of 5 total)