diaryRecordNull: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "{{Command " to "{{RV|type=command ")
(Some wiki formatting)
 
(21 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{RV|type=command
{{RV|type=command


| arma3
|game1= arma3
 
|version1= 2.00
| 2.00


|gr1= Briefing
|gr1= Briefing
Line 9: Line 8:
|gr2= Variables
|gr2= Variables


| A non-existent [[Diary Record]]. To compare non-existent objects use [[isNull]] or [[isEqualTo]]:
|descr= A non-existent [[Diary Record]]. To compare non-existent objects use [[isNull]] or [[isEqualTo]]:
* <tt>[[diaryRecordNull]] {{=}}{{=}} [[diaryRecordNull]]; {{cc|false}}</tt>
<sqf>
* <tt>[[isNull]] [[diaryRecordNull]]; {{cc|true}}</tt>
diaryRecordNull == diaryRecordNull; // false
* <tt>[[diaryRecordNull]] [[isEqualTo]] [[diaryRecordNull]]; {{cc|true}}</tt>
isNull diaryRecordNull; // true
diaryRecordNull isEqualTo diaryRecordNull; // true
</sqf>


| [[diaryRecordNull]]
{{Feature|informative|
Before {{arma3}} v2.00, [[isNull]] did not work with the diary record type and [[diaryRecordNull]] did not exist.
In order to verify a null record, it is possible to create a variable and compare against it:
<sqf>
private _diaryRecordNull = objNull createDiaryRecord [];
private _createdRecord = player createDiaryRecord ["Diary", ["Title", "Description"]];
if (_createdRecord isEqualTo _diaryRecordNull) then { hint "Failed"; };
</sqf>
}}


| [[Diary Record]]
|s1= [[diaryRecordNull]]


|x1= <code>[[isNull]] [[diaryRecordNull]]; {{cc|true}}</code>
|r1= [[Diary Record]]


|x2= <code>[[isNull]] ([[objNull]] [[createDiaryRecord]] ["Diary", ["Title", "Text"]]); {{cc|true - [[objNull]] cannot take diary records}}</code>
|x1= <sqf>isNull diaryRecordNull; // true</sqf>


|x3= <code>[[str]] [[diaryRecordNull]]; {{cc|"No diary record"}}</code>
|x2= <sqf>isNull (objNull createDiaryRecord ["Diary", ["Title", "Text"]]); // true - objNull cannot take diary records</sqf>


|x4= <code>[[private]] _diaryRecord = [[diaryRecordNull]];
|x3= <sqf>str diaryRecordNull; // "No diary record"</sqf>
[[if]] ([[damage]] [[player]] > 0.5) [[then]]
 
|x4= <sqf>
private _diaryRecord = diaryRecordNull;
if (damage player > 0.5) then
{
{
_diaryRecord = [[player]] [[createDiaryRecord]] ["Diary", ["Heal yourself", "Ask a medic"]];
_diaryRecord = player createDiaryRecord ["Diary", ["Heal yourself", "Ask a medic"]];
};
};
[[if]] ([[not]] [[isNull]] _diaryRecord) [[then]] { [[hint]] "Diary record added."; };</code>


| [[objNull]], [[controlNull]], [[displayNull]], [[grpNull]], [[locationNull]], [[taskNull]], [[teamMemberNull]], [[scriptNull]], [[configNull]], [[typeName]], [[isNull]]
if (not isNull _diaryRecord) then { hint "Diary record added."; };
</sqf>
 
|seealso= [[objNull]] [[controlNull]] [[displayNull]] [[grpNull]] [[locationNull]] [[taskNull]] [[teamMemberNull]] [[scriptNull]] [[configNull]] [[typeName]] [[isNull]]
}}
}}
<dl class="command_description">
</dl>

Latest revision as of 16:37, 10 May 2023

Hover & click on the images for description

Description

Description:
A non-existent Diary Record. To compare non-existent objects use isNull or isEqualTo:
diaryRecordNull == diaryRecordNull; // false isNull diaryRecordNull; // true diaryRecordNull isEqualTo diaryRecordNull; // true
Before Arma 3 v2.00, isNull did not work with the diary record type and diaryRecordNull did not exist.

In order to verify a null record, it is possible to create a variable and compare against it:

private _diaryRecordNull = objNull createDiaryRecord []; private _createdRecord = player createDiaryRecord ["Diary", ["Title", "Description"]]; if (_createdRecord isEqualTo _diaryRecordNull) then { hint "Failed"; };
Groups:
BriefingVariables

Syntax

Syntax:
diaryRecordNull
Return Value:
Diary Record

Examples

Example 1:
isNull diaryRecordNull; // true
Example 2:
isNull (objNull createDiaryRecord ["Diary", ["Title", "Text"]]); // true - objNull cannot take diary records
Example 3:
str diaryRecordNull; // "No diary record"
Example 4:
private _diaryRecord = diaryRecordNull; if (damage player > 0.5) then { _diaryRecord = player createDiaryRecord ["Diary", ["Heal yourself", "Ask a medic"]]; }; if (not isNull _diaryRecord) then { hint "Diary record added."; };

Additional Information

See also:
objNull controlNull displayNull grpNull locationNull taskNull teamMemberNull scriptNull configNull typeName isNull

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note