objNull – Talk
Jump to navigation
Jump to search
No edit summary |
Lou Montana (talk | contribs) m (Text replacement - "Killzone Kid" to "Killzone_Kid") |
||
(4 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
--[[User:DenV|DenV]] | |||
>> Array1 = [objNull]; | |||
>> Array1 = Array1 - [objNull]; | |||
>> Array1 == []; | |||
This code will cause an error. Deleted. | |||
:What should that be or do? | |||
Array1 == []; | |||
--[[User:Kju|Kju]] 23:12, 3 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 | |||
== notes from front page == | |||
<dl class="command_description"> | |||
<dt></dt> | |||
<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 style="display: block">_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) | |||
I | |||
Latest revision as of 13:48, 12 March 2024
--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)