I have data that would fit an associative array if they really existed in Pascal, but while the key is a string, the values are reals [0,1]. So, I have been using a TStringList and something like (from memory):
MyList.AddObjects('key1',pointer(round(value1*maxint)); I realized that someday I might get burned on a 64-bit machine ... now (using 2.0) I am reminded of this each time I compile. So.. what's the portable method? I could declare a real on the heap and store the pointer to it. Or I could write an object to hold the real and instansiate a new object when I add a record? Or I could store the values as text using the psuedo-associate properties of TStringList? All these seem clunky... I can esily imagine the first two options resulting in nasty null pointer run-time errors; they at least double the amount of space I'm using; and I imagine they will be far slower (I have a program that spends 20% of it's time allocating little tiny records on the heap). Using text to store a real seems clearly wrong. Is one of them the right/accepted/guru way to do it? Or am I missing an alternative? Should I be thinking of extending the TStringList class? Thanks! -Alan _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal