BIS fnc areEqualNotNil: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "\{\{ *cc*\| *([^}]+) *\}\}" to "// $1")
m (Some wiki formatting)
 
(One intermediate revision by the same user not shown)
Line 15: Line 15:
|r1= [[Boolean]]
|r1= [[Boolean]]


|x1= <code>[<nowiki/>[1, 2, [3, [4, 5]]],   [1, 2, [3, [4, 5]]]]   [[call]] [[BIS_fnc_areEqualNotNil]]; // true
|x1= <sqf>
[<nowiki/>[1, 2, [3, [4, [[nil]]]]], [1, 2, [3, [4, [[nil]]]]]] [[call]] [[BIS_fnc_areEqualNotNil]]; // false</code>
[[1, 2, [3, [4, 5]]], [1, 2, [3, [4, 5]]]] call BIS_fnc_areEqualNotNil; // true
[[1, 2, [3, [4, nil]]], [1, 2, [3, [4, nil]]]] call BIS_fnc_areEqualNotNil; // false
</sqf>


|x2= <code>[<nowiki/>[[nil]], [[nil]]] [[call]] [[BIS_fnc_areEqualNotNil]]; // false</code>
|x2= <sqf>[nil, nil] call BIS_fnc_areEqualNotNil; // false</sqf>


|seealso= [[isEqualTo]] [[BIS_fnc_areEqual]]
|seealso= [[isEqualTo]] [[BIS_fnc_areEqual]]
}}
}}

Latest revision as of 16:31, 13 July 2022

Hover & click on the images for description

Description

Description:
Compares all elements of passed array between each other and returns true is all are defined and identical.
Very fast, different from BIS_fnc_areEqual in that nil values will not be considered equal to each other.
Execution:
call
Groups:
Variables

Syntax

Syntax:
[anything1, anything2, …] call BIS_fnc_areEqualNotNil
Parameters:
anythings: Anything - nil values won't be considered equal
Return Value:
Boolean

Examples

Example 1:
[[1, 2, [3, [4, 5]]], [1, 2, [3, [4, 5]]]] call BIS_fnc_areEqualNotNil; // true [[1, 2, [3, [4, nil]]], [1, 2, [3, [4, nil]]]] call BIS_fnc_areEqualNotNil; // false
Example 2:
[nil, nil] call BIS_fnc_areEqualNotNil; // false

Additional Information

See also:
isEqualTo BIS_fnc_areEqual

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