function abc(x,y)
return 1,2,3
end
function cde(x,y)
return 1 + "a"
end
print( pcall(abc, x, y) ) ---> true 1,2,3
print( pcall(cde, x, y) ) ---> false c:\function_a.lua:2: attempt to perform arithmetic on a string value
function f1(x) f2(x) end
function f2(x) f3(x) end
function f3(x) f4(x) end
function f4(x)
if x == 1 then
error("", 1) -- f4()でエラー
elseif x == 2 then
error("", 2) -- f3()でエラー
elseif x == 3 then
error("", 3) -- f2()でエラー
elseif x == 4 then
error("", 4) -- f1()でエラー
else
error("", 5) -- トップレベルでエラー
end
end