Difference between revisions of "False"

From OpenEUO
Jump to: navigation, search
m (Created page with "== Description == false is a lua keyword and valid value of type 'boolean'. While false is the opposite of true, nil is also considered false unless explicitly tested for. ...")
 
m (Description)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
 
== Description ==
 
== Description ==
  
false is a lua keyword and valid value of type 'boolean'.  While false is the opposite of true, [[nil]] is also considered false unless explicitly tested for.
+
false is a lua keyword and valid value of type 'boolean'.  While false is the opposite of [[true]], [[nil]] is also considered false unless explicitly tested for.  All boolean operators return either true or false.
  
 
  local a,b,c = true,false,nil
 
  local a,b,c = true,false,nil
Line 15: Line 15:
 
  --> 'true'
 
  --> 'true'
 
  --> 'false'
 
  --> 'false'
 +
 +
== See Also ==
 +
 +
* [[nil]]
 +
 +
* [[true]]
 +
 +
* [[type]]

Latest revision as of 19:23, 1 November 2010

Description

false is a lua keyword and valid value of type 'boolean'. While false is the opposite of true, nil is also considered false unless explicitly tested for. All boolean operators return either true or false.

local a,b,c = true,false,nil
print(a == b)
print(a ~= b)
print(a ~= c)
print(b ~= c)
print(c ~= nil)
--> 'false'
--> 'true'
--> 'true'
--> 'true'
--> 'false'

See Also