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 (→Usage Example) |
||
(2 intermediate revisions by the same user not shown) | |||
Line 9: | Line 9: | ||
== Usage Example == | == Usage Example == | ||
− | local sl = dofile(getinstalldir()..' | + | local sl = dofile(getinstalldir()..'lib/simplelib.lua') |
non = sl.non | non = sl.non | ||
null = sl.null | null = sl.null | ||
Line 18: | Line 18: | ||
print(d) | print(d) | ||
− | --> | + | --> false |
− | + | true | |
− | + | true | |
− | + | false | |
== Description == | == Description == | ||
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]] |
Latest revision as of 17:15, 24 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.