Difference between revisions of "Assert"

From GiderosMobile
Line 2: Line 2:
 
'''Available since:''' Gideros 2011.6<br/>
 
'''Available since:''' Gideros 2011.6<br/>
 
=== Description ===
 
=== 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!"
+
<translate>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!"</translate>
 
<source lang="lua">
 
<source lang="lua">
 
  assert(v,message)
 
  assert(v,message)
 
</source>
 
</source>
 
=== Parameters ===
 
=== Parameters ===
'''v''': (any) expression/function to assert <br/>
+
'''v''': (any) <translate>expression/function to assert</translate> <br/>
'''message''': (string) error message if assert fails '''optional'''<br/>
+
'''message''': (string) <translate>error message if assert fails</translate> '''optional'''<br/>

Revision as of 13:34, 23 August 2018

Available since: Gideros 2011.6

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