nil is no value. This can be used to delete a variable, and can be returned from a function whenever invalid data is present.
Also see the
LUA documentation on nil for more information.
-- Examples from http://lua-users.org/wiki/LuaTypesTutorial -- By setting a variable to nil you can delete a variable. e.g. local x = 2.5 print(x) -- 2.5 x = nil print(x) -- nil -- You can test to see if a variable exists by checking whether its value is nil. print(x == nil) -- true x = 7 print(x == nil) -- false print(x) -- 7
Data Types
Functions
SCAR Home
Wiki Home