yeah, but if you're explaining why sort doesn't work on a table with "key1" and "key2" as indices, i'm thinking maybe talking about writing a sort function is not helpful.
the 2ndary sortable table (as phanx posted) is probably the better move for a beginner. you get the "random access" of a dictionary with the sortability of an array. you just need to an extra layer of indirection.
You'd better with one table with all keys and another table with all values. That's only 2 tables even with 700 entries in them. Your solution means 701 tables for 700 entries. This is pretty bad if this has to be often and dynamically updated during the addon lifetime.
yeah, that was more for illustration purposes. also, not sure how you sort two tables at the same time using one table as the keys and the other as the values.
by that, he means that only "arrays" have a defined order (and so can be re-ordered via a sort). in lua, arrays are tables with consecutive integer indices, whereas dictionaries are pretty much all other tables.