Nothing: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
mNo edit summary
m (Minor tip)
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
A variable of type '''Nothing''' is an '''undefined variable'''. When converted to a string with [[str]] or [[format]], this variable will always return [[scalar bool array string 0xe0ffffef]] (in [[Armed Assault]]) or [[scalar bool array string 0xfcffffef]] (in [[Operation Flashpoint]]).
An expression of type '''Nothing''' is no value. It cannot be assigned to a variable. It exists because each expression needs to return some value and needs to have some clearly identified [[:Category:Data Types|type]].
 
== Undefining Variables ==
 
You can use [[nil]] to undefine variables.
 
myVar = 1;
...
myVar = nil;
myVar => undefined
 
== Comparisons ==
 
No comparison with variables of this type will work.
 
'''Example:'''
 
// error
[[if]] (undefinedVar == ...) [[then]] ...
 
// error
[[if]] (undefinedVar == undefinedVar) [[then]] ...


Its presence can be checked using [[isNil]].


[[Category: Magic Types]]
[[Category: Magic Types]]

Latest revision as of 19:42, 22 December 2014

An expression of type Nothing is no value. It cannot be assigned to a variable. It exists because each expression needs to return some value and needs to have some clearly identified type.

Its presence can be checked using isNil.