I haven't tested this but it is a variant of one that was listed at :
http://forums.coronalabs.com/topic/4...e-on-2-values/
Lua Code:
-- Sort Function
local function SortTableByKey(a, b )
if (a.key < b.key) then
return true
elseif (a.key > b.key) then
return false
end
end
-- Build table that can be sorted
local accountant_sorted_data = {}
for key,value in pairs(Accountant_Data) do
table.insert(accountant_sorted_data = { "Key" = key, "Value" = value })
end
-- Sort Table
table.sort( accountant_sorted_data, SortTableByKey)