find unused index numbers in coll?

May 15, 2011 at 12:16am

find unused index numbers in coll?

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!
MH

– Pasted Max Patch, click to expand. –
#57133
May 15, 2011 at 5:36am

Hello mharter,

What are you tring to do ?

IMHO you did bad assumption about [zl sub] function ;-)

– Pasted Max Patch, click to expand. –

you can use [zl filter] or [zl unique] instead of …

#204629
May 15, 2011 at 6:29am

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]

#204630
May 15, 2011 at 8:46am

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. –
#204631
May 15, 2011 at 5:18pm

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. –
#204632
May 15, 2011 at 6:30pm

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!
MH

#204633

You must be logged in to reply to this topic.