objNull – Talk
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - "<dl class="command_description"> <dd class="notedate">" to "<dl class="command_description"> <dt></dt> <dd class="notedate">") |
Lou Montana (talk | contribs) m (Text replacement - "<code>" to "<code style="display: block">") |
||
Line 22: | Line 22: | ||
<dd class="note"> | <dd class="note"> | ||
'''objNull''' simulates a real object parameters, e.g. you can get or set them. This may come useful in cases where the vairable handle should be always an object of any kind instead of [[nil]] to avoid code malfunction on undefined variable or wrong type. | '''objNull''' simulates a real object parameters, e.g. you can get or set them. This may come useful in cases where the vairable handle should be always an object of any kind instead of [[nil]] to avoid code malfunction on undefined variable or wrong type. | ||
<code>_damage = [[damage]] objNull; // will return 0 | <code style="display: block">_damage = [[damage]] objNull; // will return 0 | ||
_position = [[getPos]] objNull; // will return [0,0,0] | _position = [[getPos]] objNull; // will return [0,0,0] | ||
</code> | </code> |
Revision as of 11:52, 11 January 2023
--DenV
>> Array1 = [objNull]; >> Array1 = Array1 - [objNull]; >> Array1 == [];
This code will cause an error. Deleted.
- What should that be or do?
Array1 == [];
--Kju 23:12, 3 April 2010 (CEST)
--DenV 03:54, 4 April 2010 (CEST)
- I don't know :) But this code doesn't work, and shouldn't work, becouse the operator == doesn't work with arrays. I just commented on the reason of editing the article: http://community.bistudio.com/wiki?title=objNull&diff=56152&oldid=55981
notes from front page
- Posted on September 12, 2016 - 13:14 (UTC)
- Demellion
-
objNull simulates a real object parameters, e.g. you can get or set them. This may come useful in cases where the vairable handle should be always an object of any kind instead of nil to avoid code malfunction on undefined variable or wrong type.
_damage = damage objNull; // will return 0 _position = getPos objNull; // will return [0,0,0]
- Not true. You cannot set anything on objNull, and getters just return default values. Killzone Kid (talk) 23:21, 12 September 2016 (CEST)