need coll help - indexing w float

dd1984's icon

so, i'm using this coll jitcell config in my patch, nothing too weird. what i need to do is have the index numbers be floats. since coll won't accept that, any ideas for a work around to have the first number of the list line (the float)not repeat, or replace the line if that float has already been entered (ie, act like the index)?

thanks!
drew

Eddy's icon

You could multiply the float you want to use as the index by 1000 and then using an integer version of the result as the index to coll... this would preserve 3 decimal places. Use greater powers of 10 for more precision.

Eddy

dd1984's icon

thanks; it's a good idea, but then the jitcel portion of my patch (through refer coll) displays the multiplied number, not the float i need.

still brainstorming . . .

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

not sure if this is what you want to do, but you can have the float be a symbol in the coll:

dd1984's icon

damn, i'm using max 4.6 and can't see you're doing. coll stores things beginning with an index, and a list of whatever and the index can't be a float. i can have my float be the first number after the index, but i need to find a way of making that float unrepeatable (no duplicates), or in the event a duplicate is made, it replaces the first instance. is there and object, similar to [urn] that filters numbers?

drew

dd1984's icon

bbracken, i totally apologize. using [tosymbol] absolutely works. is there a way to limit the extra zeros [tosymbol] creates?

drew

Ben Bracken's icon

something like this?

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

dd1984's icon

yep, right on the money. unfortunately, using this method, i'm now having issues deleting items from the coll. neither the remove nor delete message doesn't seem to work with the symbol. am i missing something?

and forgive my manners, i appreciate the help - the symout worked great (thanks for that)! i wasn't familiar with it at all. makes me think how many other command phrases i'm missing. any reading to recommend?

drew

Ben Bracken's icon

Drew,

You have to do some rounding/symbol making before you pump it into the coll. Another sprintf will be your friend:

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

dd1984's icon

my whoops. i jumped right in to combining the symout message with the remove message via [sprintf %s %s]. that's a bad argument. thanks again!