BIS fnc arrayCompare: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - " |GROUP1" to "|GROUP1=")
m (Some wiki formatting)
 
(33 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Function|Comments=
{{RV|type=function
____________________________________________________________________________________________


| arma2 |Game name=
|game1= arma2
|version1= 1.00


|1.00|Game version=
|game2= arma2oa
|version2= 1.50


|gr1= Arrays|GROUP1=
|game3= tkoh
____________________________________________________________________________________________
|version3= 1.00


| This function checks if two arrays are containing the same elements in the same order.
|game4= arma3
{{Important|This function is deprecated in {{arma2}} as it fails with certain data types; see [[BIS_fnc_areEqual]] for {{arma2}}.}}
|version4= 0.50
{{Feature arma3|Use [[isEqualTo]] instead.}}|Description=
____________________________________________________________________________________________


| [array1, array2] call [[BIS_fnc_arrayCompare]] |Syntax=
|gr1= Arrays


|p1= array1: [[Array]] |Parameter 1=
|descr= This function checks if two arrays are containing the same elements in the same order.
{{Feature|important|This function is deprecated in {{arma2}} as it fails with certain data types; see [[BIS_fnc_areEqual]] for {{arma2}}.}}
{{Feature|arma3|Use [[isEqualTo]] instead.}}


|p2= array2: [[Array]] |Parameter 2=
|s1= [array1, array2] call [[BIS_fnc_arrayCompare]]


| [[Boolean]] |Return value=
|p1= array1: [[Array]]
____________________________________________________________________________________________


|x1= <code>_array1 = [0,1,2];
|p2= array2: [[Array]]
_array2 = [0,1,2];
[_array1, _array2] [[call]] [[BIS_fnc_arrayCompare]]; {{codecomment|// returns [[true]]}}</code> |Example 1=
____________________________________________________________________________________________


| [[BIS_fnc_areEqual]], [[BIS_fnc_areEqualNotNil]], [[isEqualTo]] |See also=
|r1= [[Boolean]]
}}


<h3 style="display:none">Notes</h3>
|x1= <sqf>
<dl class="command_description">
private _array1 = [0,1,2];
<!-- Note Section BEGIN -->
private _array2 = [0,1,2];
[_array1, _array2] call BIS_fnc_arrayCompare; // returns true
</sqf>


<!-- Note Section END -->
|seealso= [[BIS_fnc_areEqual]] [[BIS_fnc_areEqualNotNil]] [[isEqualTo]]
</dl>
}}
 
<h3 style="display:none">Bottom Section</h3>
[[Category:Functions|{{uc:arrayCompare}}]]
[[Category:Function Group: Arrays|{{uc:arrayCompare}}]]
[[Category:{{Name|arma2}}: Functions|{{uc:arrayCompare}}]]
[[Category:{{Name|arma2oa}}: Functions|{{uc:arrayCompare}}]]
[[Category:{{Name|tkoh}}: Functions|{{uc:arrayCompare}}]]
[[Category:{{Name|arma3}}: Functions|{{uc:arrayCompare}}]]

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