Luaでは関数が用意されていないため、ソート用の配列を作成し並べる必要がある。
function tableSort(obj)
local sortkey = {}
local n = 0
for k,v in pairs(obj) do
n = n + 1
sortkey[n] = k
end
table.sort(sortkey,function(a,b)
return tonumber(a) < tonumber(b)
end)
return sortkey
end