Difference between revisions of "assert"
Jump to navigation
Jump to search
Technolapin (talk | contribs) (Created page with "The assert() function is a way to execute functions. assert(foo, errmsg) It will try to execute the function foo and will send errmsg as an error if it fail.") |
Technolapin (talk | contribs) |
||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
The assert() function is a way to execute functions. | The assert() function is a way to execute functions. | ||
+ | <source lang="lua"> | ||
assert(foo, errmsg) | assert(foo, errmsg) | ||
+ | </source> | ||
It will try to execute the function foo and will send errmsg as an error if it fail. | It will try to execute the function foo and will send errmsg as an error if it fail. |
Latest revision as of 20:57, 8 November 2014
The assert() function is a way to execute functions.
assert(foo, errmsg)
It will try to execute the function foo and will send errmsg as an error if it fail.