lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

can anyone explain me how to sort a table whose keys are strings using a custom sorting function ? 

I've tried this code:

It doesn't seem to work (table is not sorted, because the comparator function is not executed).

The tables i want to sort look more or less like to this :

local t = {}
t["03:05:30"] = 80
t["04:05:21"] = 40
t["01:03:03"] = 20

Thanks for any suggestion,


PS: i found a note about this corner-case at this url:  but not on the reference manual..