Print table in order ?
How do I print this array/table in order every time without changing the structure of it?
Code:
local rbuffs = { ["Bloodlust Heroism"] = false, |
You need to define an interator function.
See http://www.lua.org/pil/19.3.html for reference. (the 'pairsByKeys' function example should be exactly what you want) |
I'd strongly recommend not using the function on that linked page, as it wastes memory creating a new table and a new function every time you call it. Something like this should work the same without creating new objects on every call:
Code:
local pairsByKey |
Thanks guys for the help. It looks like I am going to have to change the structure of my array to include indices. Otherwise, any sorting function will kill my cpu cycles.
|
All times are GMT -6. The time now is 12:01 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI