Yes, you have to re-sort the indexes for every record you add, however, you FIND that index number by a simple binary search (very fast), which you slightly modify for that purpose.
Then, all you need to do is increment each of the current index numbers, by one, if they are above the number that has been found through the binary search, just a simple increment. The alternative I see is completely re-sorting all the indexes, or worse yet, all the struct's. Surely, that's a worse complexity. <grin> Dave
