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. –

Copy all of the following text. Then, in Max, select New From Clipboard.

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. –

Copy all of the following text. Then, in Max, select New From Clipboard.

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.