BIS fnc areEqual: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Generated by BIS_fnc_exportFunctionsToWiki)
m (Some wiki formatting)
 
(37 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{{RV|type=function


{{Function|= Comments
|game1= arma2
____________________________________________________________________________________________
|version1= 1.00


| arma2 |= Game name
|game2= arma2oa
|version2= 1.50


|1.00|= Game version
|game3= tkoh
____________________________________________________________________________________________
|version3= 1.00


| <pre>
|game4= arma3
/************************************************************
|version4= 0.50
Are Equal


Parameters: [anything1, anything2, anything3, ...]
|gr1= Variables


Two or more elements can be passed.
|descr= This function returns true if all of the passed data elements are of the same type and value. One or more elements can be passed.


This returns true if all of the passed data elements are of the same
{{Feature|arma3|In {{arma3}}, see [[isEqualTo]].}}
type and value.


NOTES:
Note:
* This function is an improvement over the == operator because it can handle any data type in any combination.
* For arrays, it returns true if both arrays hold the same elements in the same order.
* If both values are undefined / nil / null, then this function will return true.


-This function is an improvement over the == operator, because
|pr= EXTREMELY large strings (>&nbsp;4k) or compiled code (from a file, for example) might not be properly compared if they are only different near the end of the file.
it can handle any data type in any combination.


-For arrays, it returns true if both arrays hold the same elements
|s1= [anything1, anything2, ..., anythingN] call [[BIS_fnc_areEqual]]
in the same order.


-If both values are undefined / nil / null, then this function will return
|p1= anythingM: [[Anything]] - any [[:Category:Data_Types|data type]]
true.


-WARNING: EXTREMELY large strings (>4k) or compiled code (from
|r1= [[Boolean]]
a file, for example) might not be properly compared, if they are
only different near the end of the file.


************************************************************/
|x1= <sqf>
 
[0, "0"] call BIS_fnc_areEqual; // false
</pre><small>''(Placeholder description extracted from the function header by [[BIS_fnc_exportFunctionsToWiki]])''</small> |= Description
[0, 1 + 1 - 2] call BIS_fnc_areEqual; // true
____________________________________________________________________________________________
[str 50, "50"] call BIS_fnc_areEqual; // true
 
</sqf>
| <!-- [] call [[BIS_fnc_areEqual]]; --> |= Syntax
 
|p1= |= Parameter 1
 
| |= Return value
____________________________________________________________________________________________
 
|x1= <code></code> |=
____________________________________________________________________________________________
 
| |= See also


|seealso= [[isEqualTo]] [[BIS_fnc_areEqualNotNil]]
}}
}}
<h3 style="display:none">Notes</h3>
<dl class="command_description">
<!-- Note Section BEGIN -->
<!-- Note Section END -->
</dl>
<h3 style="display:none">Bottom Section</h3>
[[Category:Function Group: Variables|{{uc:areEqual}}]]
[[Category:Functions|{{uc:areEqual}}]]
[[Category:{{Name|arma2}}: Functions|{{uc:areEqual}}]]
[[Category:{{Name|arma2oa}}: Functions|{{uc:areEqual}}]]
[[Category:{{Name|tkoh}}: Functions|{{uc:areEqual}}]]
[[Category:{{Name|arma3}}: Functions|{{uc:areEqual}}]]

Latest revision as of 22:12, 30 March 2024

Hover & click on the images for description

Description

Description:
This function returns true if all of the passed data elements are of the same type and value. One or more elements can be passed.
Arma 3
In Arma 3, see isEqualTo.

Note:

  • This function is an improvement over the == operator because it can handle any data type in any combination.
  • For arrays, it returns true if both arrays hold the same elements in the same order.
  • If both values are undefined / nil / null, then this function will return true.
Execution:
call
Problems:
EXTREMELY large strings (> 4k) or compiled code (from a file, for example) might not be properly compared if they are only different near the end of the file.
Groups:
Variables

Syntax

Syntax:
[anything1, anything2, ..., anythingN] call BIS_fnc_areEqual
Parameters:
anythingM: Anything - any data type
Return Value:
Boolean

Examples

Example 1:
[0, "0"] call BIS_fnc_areEqual; // false [0, 1 + 1 - 2] call BIS_fnc_areEqual; // true [str 50, "50"] call BIS_fnc_areEqual; // true

Additional Information

See also:
isEqualTo BIS_fnc_areEqualNotNil

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