how can I retrieve a coll index's associated symbol?

pseudostereo's icon

A very basic question about coll:

A coll index can store data, and it can also have a symbol associated with it (by using the 'assoc' message). However, once a symbol is associated with the index, there seems to be no way to retrieve it.

If you recall an index (either by integer, by symbol or via a 'dump' message), the first outlet returns the data, and the second outlet returns the index number. What if I only know the index number, and I want to discover the symbol that has been associated with that index number?

I can't believe that there isn't a way to do this, but I haven't been able to find an answer either in the docs or on the forums.

Max Patch
Copy patch and select New From Clipboard in Max.

mzed's icon

I can't think of a legitimate way to do this.

As a workaround, maybe you could store the symbolindex association in a separate coll, or build the symbol into the coll data?

Rick's icon
Max Patch
Copy patch and select New From Clipboard in Max.

Another workaround would be to save the coll file and use the text object to create the umenu.

pseudostereo's icon

Thanks, those are both workable solutions – I'll probably go with the text object so that I don't have to add yet another coll to the project.

I'm kind of surprised that coll doesn't have this functionality built in – but even more amazed that no one has ever needed to do this in all the years that coll has been around.

So I guess that, if no answer (as opposed to a workaround) is forthcoming, this should be considered a feature request.

Robin Parmar's icon

My other suggestion is to use a [dict]. They are worth learning. I should do a tutorial soon, but no time presently.

Dan Laüt's icon

Or, at the time of the association, write the symbol to the coll as well using merge. Then you just zl.encil it off the data output. (I would prefer prepending to the data, but coll doesn't seem to have that feature.

Max Patch
Copy patch and select New From Clipboard in Max.