loadfile
function loadfile(path: string): ()Parameter
Examples
writefile("file6.lua", "return 10 + ...")
local Func, Err = loadfile("file5.lua")
print(Func(1), Err) -- Output: 11, nilwritefile("file6.lua", "retrn 10 ...")
local Func, Err = loadfile("file5.lua")
if Func == nil and string.find(Err, "expected assignment or a function call") then
print("Caught the error") -- Output: Caught the error
endLast updated