BIS fnc arrayCompare: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "<code>([^<]*)\[\[([a-zA-Z][a-zA-Z0-9_]+)\]\]([^<]*) *<\/code>" to "<code>$1$2$3</code>")
m (Some wiki formatting)
 
(4 intermediate revisions by the same user not shown)
Line 19: Line 19:
{{Feature|arma3|Use [[isEqualTo]] instead.}}
{{Feature|arma3|Use [[isEqualTo]] instead.}}


|s1=[array1, array2] call [[BIS_fnc_arrayCompare]]
|s1= [array1, array2] call [[BIS_fnc_arrayCompare]]


|p1= array1: [[Array]]
|p1= array1: [[Array]]
Line 27: Line 27:
|r1= [[Boolean]]
|r1= [[Boolean]]


|x1= <code>private _array1 = [0,1,2];
|x1= <sqf>
_array2 = [0,1,2];
private _array1 = [0,1,2];
[_array1, _array2] call [[BIS_fnc_arrayCompare]]; {{codecomment|// returns [[true]]}}</code>
private _array2 = [0,1,2];
[_array1, _array2] call BIS_fnc_arrayCompare; // returns true
</sqf>


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

Latest revision as of 23:31, 12 July 2022

Hover & click on the images for description

Description

Description:
This function checks if two arrays are containing the same elements in the same order.
This function is deprecated in Arma 2 as it fails with certain data types; see BIS_fnc_areEqual for Arma 2.
Arma 3
Use isEqualTo instead.
Execution:
call
Groups:
Arrays

Syntax

Syntax:
[array1, array2] call BIS_fnc_arrayCompare
Parameters:
array1: Array
array2: Array
Return Value:
Boolean

Examples

Example 1:
private _array1 = [0,1,2]; private _array2 = [0,1,2]; [_array1, _array2] call BIS_fnc_arrayCompare; // returns true

Additional Information

See also:
BIS_fnc_areEqual BIS_fnc_areEqualNotNil isEqualTo

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