Originally Posted by Iriel
We'll have loadstring in 1.10! Yay!
|
Thank you very much, I'm very happy... but also a bit sad because nobody reads the european forums, I mean nobody like slouken, or someone else who would be competent enough to respond to our questions.
about the _ERRORMESSAGE hook, thanks about the hint, I didn't know there was something like that, but loadstring() is significantly different that RunScript() because it doesn't run the code, it returns a function with the parsed string as function body.
I'm using the following code to get around this, but that still fails if the string can't be parsed properly, setfenv() is there to make sure that the argString doesn't contain any function calls
Code:
RunScript("argFunc = function() return "..argString.." end")
if (argFunc) then
setfenv(argFunc, { })
local argList = { pcall(argFunc) }
if (argList[1]) then
argList[1] = moduleObject
moduleObject[moduleFunction](unpack(argList))
end
argFunc = nil
end
btw, this is code from commChannels (
http://www.curse-gaming.com/mod.php?addid=2606 )