Difference between revisions of "Pcall"
From OpenEUO
(Created page with " pcall (f, arg1, ···) Calls function f with the given arguments in protected mode. This means that any error inside f is not propagated; instead, pcall catches the error and ...") |
|||
Line 4: | Line 4: | ||
The related lua base function xpcall is unavailable in openeuo. | The related lua base function xpcall is unavailable in openeuo. | ||
+ | |||
+ | [[Assert]] | ||
+ | |||
+ | [[Dofile]] | ||
+ | |||
+ | [[Dostring]] | ||
+ | |||
+ | [[Loadfile]] | ||
+ | |||
+ | [[Loadstring]] |
Latest revision as of 09:46, 9 October 2010
pcall (f, arg1, ···)
Calls function f with the given arguments in protected mode. This means that any error inside f is not propagated; instead, pcall catches the error and returns a status code. Its first result is the status code (a boolean), which is true if the call succeeds without errors. In such case, pcall also returns all results from the call, after this first result. In case of any error, pcall returns false plus the error message.
The related lua base function xpcall is unavailable in openeuo.