Difference between revisions of "Assert"
From GiderosMobile
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
− | + | '''Available since:''' Gideros 2011.6<br/> | |
− | ''' | + | '''Class:''' [[(global)]]<br/> |
− | ''' | ||
− | === | + | === Description === |
− | + | Issues an error when the value of its argument v is false (i.e., nil or false); otherwise, returns all its arguments. message is an error message; when absent, it defaults to "assertion failed!" | |
<source lang="lua"> | <source lang="lua"> | ||
assert(v,message) | assert(v,message) | ||
</source> | </source> | ||
− | === | + | === Parameters === |
− | '''v''': (any) | + | '''v''': (any) expression/function to assert<br/> |
− | '''message''': (string) | + | '''message''': (string) error message if assert fails '''optional'''<br/> |
{{(global)}} | {{(global)}} |
Revision as of 22:46, 5 December 2020
Available since: Gideros 2011.6
Class: (global)
Description
Issues an error when the value of its argument v is false (i.e., nil or false); otherwise, returns all its arguments. message is an error message; when absent, it defaults to "assertion failed!"
assert(v,message)
Parameters
v: (any) expression/function to assert
message: (string) error message if assert fails optional