objNull – Talk

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Reverted edits by Heecf..... (talk) to last revision by DenV)
Line 13: Line 13:
--[[User:DenV|DenV]] 03:54, 4 April 2010 (CEST)
--[[User:DenV|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
: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 ==
<dl class="command_description">
<dd class="notedate">Posted on September 12, 2016 - 13:14 (UTC)</dd>
<dt class="note">[[User:Demellion|Demellion]]</dt>
<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.
<code>_damage = [[damage]] objNull; // will return 0
_position = [[getPos]] objNull; // will return [0,0,0]
</code>
</dd>
</dl>
:Not true. You cannot set anything on [[objNull]], and getters just return default values. [[User:Killzone Kid|Killzone Kid]] ([[User talk:Killzone Kid|talk]]) 23:21, 12 September 2016 (CEST)

Revision as of 23:21, 12 September 2016

--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)