3
Well, I’m looking to turn a string into a table. I tried so:
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)
Can anyone handle it? Thank you.
gmatch
does not work that way. Norpairs
.– lhf