lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> Sorry, I have confused with lua_pcall (the C fuction). So I just
> run a lua function with
> 
> if pcall(myfunc()) then
>    no error
> else
>    error
> end
> 
> A try-catch around a block does not work, so I must call each "function"
> with pcall, do I ?

if not pcall(function ()
  foo1()   -- 1st call
  foo2()   -- 2nd call
  ...      -- whatever
end) then
  error
end

-- Roberto