Posted 20 June 2013 - 01:15 PM
Hello everyone. I've got a small problem. An error, that crashes LUA, pointing towards the function non-existence.
But there IS a function, and it loads before it is called. Here is the code, for everything else go to PM
If, for example, I use:
lua tbl = msg:split(":")
Then there's an error "attempt to call nill"
Thanks in advance.
But there IS a function, and it loads before it is called. Here is the code, for everything else go to PM
function string:split(sep)
local sep, fields = sep or ":", {}
local pattern = string.format("([^%s]+)", sep)
self:gsub(pattern, function(c) fields[#fields+1] = c end)
return fields
end
If, for example, I use:
lua tbl = msg:split(":")
Then there's an error "attempt to call nill"
Thanks in advance.
Edited by