Difference between revisions of "Non"
From OpenEUO
m (Created page with "== Calling Convention == Call local r[,...] = sl.non([...]) Args a1...aN are of any type Results r1...rN are boolean == Usage Example == local sl = dofile(getinstalldir().....") |
m (→See Also) |
||
Line 32: | Line 32: | ||
== See Also == | == See Also == | ||
+ | |||
+ | * [http://www.easyuo.com/openeuo/wiki/index.php/Simplelib simplelib] | ||
* [[nil]] | * [[nil]] | ||
+ | |||
+ | * [[null]] | ||
* [[ERR]] | * [[ERR]] | ||
* [[type]] | * [[type]] |
Revision as of 08:34, 2 November 2010
Calling Convention
Call
local r[,...] = sl.non([...])
Args
a1...aN are of any type
Results
r1...rN are boolean
Usage Example
local sl = dofile(getinstalldir()..'/lib/simplelib.lua') non = sl.non null = sl.null local a,b,c,d = non(false,nil,null,0) print(a) print(b) print(c) print(d)
--> 'false' --> 'true' --> 'true' --> 'false'
Description
Tests each supplied argument as to whether it is nil or null. If so, then non returns true for that value, otherwise false. non returns the same number of values as the number of arguments it accepted.
Upon Error
If non receives no arguments, then it returns a single nil value.