I need to store the first ten values in sorted order. My data structure:
TMyRecord = record
Number: Integer;
Value: Float;
end
I will calculate a bunch of float values. I need to save the top 10 values of the float. Each value has an associated number. I want to add “sets” ... If my float value is above one of the top 10, it should add itself to the list, and then the “old” number 10, now 11, will be discarded. I should be able to access the list in an ordered order (float value) ...
It is almost like a TStringList that supports sorted order ....
Is there something like this already built into Delphi 2010?
source
share