[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: persistent storage using SQL yet with table like access ?
- From: "Richard Simes" <ricardo.nz@...>
- Date: Tue, 27 Mar 2007 20:16:06 +1200
perhaps you could use something along these lines:
db = {5, 76, 124, 76, 234}
setmetatable(db, {
__call = function()
local count = 0
return function()
count = count + 1 -- replace with code that gets
the next val
return db[count] -- from your database
end
end
})
for v in db() do
print(v)
end
look here for more examples:
http://www.lua.org/pil/7.1.html