Indexing coll with floats and Integers

May 17, 2010 at 1:40pm

Indexing coll with floats and Integers

I’m looking for a way to store data in coll, and I usually do it with Integers. Since I’m using it to store some cues (1,2,3,4, etc.), I’d like to be able to insert a 1.1 cue. But for indexing data in coll, float are recognized as symbols, so it doesn’t allow the same ordering.
Anybody has an hint?
Maybe storing Integers as symbolized float… That seems tricky, so is there a better way?

May 18, 2010 at 5:08pm

A typical technique is to multiply (and round) all your float values by some convenient constant (say, 100.0) and use the resulting integers as coll indices.

The only drawback is that you have to decide in advance what your maximum granularity is going to be.

May 18, 2010 at 5:35pm

Another solution is to not use the que numbers as indexes, but regard them as names or identifiers that you store with each cue.

May 20, 2010 at 3:47pm

Thanks Peter,
I think it’s the easiest way to do what I want.


You must be logged in to reply to this topic.