Difference between revisions of "Non"
From OpenEUO
m (→Usage Example) |
m (→Usage Example) |
||
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 |
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.