lua-users home
lua-l archive

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


For example, I have following codes:

t = {
x=1,
y=2,
a=3,
b=4
}

for k, v in pairs(t) do
print(k, v)
end

then the output is:
y       2
x       1
a       3
b       4

If I want the output to be like follow:
x       1
y       2
a       3
b       4
just in the order of how I construct the table, how could I do? Thanks!