lua-users home
lua-l archive

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


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

I've tried this code:   http://codepad.org/QakDRqwX

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,

Valerio

PS: i found a note about this corner-case at this url: http://www.wowwiki.com/API_sort  but not on the reference manual..