Posted 23 March 2017 - 12:49 PM
Basically, what I'm trying to do is load a piece of code that returns the value "hello".
But, I can't get it to display said returned value when using pcall.
Any ideas as to why?
But, I can't get it to display said returned value when using pcall.
Any ideas as to why?
local code = io.read()
local f = loadstring(code)
local ok, err = pcall(f)
if err then
write("Program error: "..err.."\n")
else
term.setTextColor(colors.yellow)
print(ok,err)
term.setTextColor(colors.white)
end
EDIT: Here's what it spits out:Edited on 23 March 2017 - 11:54 AM