Well, I'm trying to transform a string into a table. I tried this way:
toset = "nb = 10, gb = 20, sb = 0, sfb = 0, ub = 0;"
toget = "nb = (.-), gb = (.-), sb = (.-), sfb = (.-), ub = (.-);"
t = toset:gmatch(toget)
for a,b,c,d,e in pairs(t) do
print(a.." "..b.." "..c.." "..d.." "..e)
end
But returns this error:
[string "stdin"]:4: bad argument #1 to 'pairs' (table expected, got function)
Does anyone know how to solve it? Thank you.