BIS fnc areEqual: Difference between revisions

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


'''NOTES:'''
Note:
* This function is an improvement over the {{=}}{{=}} operator, because it can handle any data type in any combination.
* 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.
* 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.
* If both values are undefined / nil / null, then this function will return true.
* '''WARNING:''' 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.


|s1= [anything1, anything2, , anythingN] call [[BIS_fnc_areEqual]]
|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.
 
|s1= [anything1, anything2, ..., anythingN] call [[BIS_fnc_areEqual]]


|p1= anythingM: [[Anything]] - any [[:Category:Data_Types|data type]]
|p1= anythingM: [[Anything]] - any [[:Category:Data_Types|data type]]
Line 31: Line 32:
|r1= [[Boolean]]
|r1= [[Boolean]]


|x1= <code>[0, "0"] call [[BIS_fnc_areEqual]]; // false
|x1= <sqf>
[0, 1 + 1 - 2] [[call]] [[BIS_fnc_areEqual]]; // true
[0, "0"] call BIS_fnc_areEqual; // false
[str 50, "50"] [[call]] [[BIS_fnc_areEqual]]; // true</code>
[0, 1 + 1 - 2] call BIS_fnc_areEqual; // true
[str 50, "50"] call BIS_fnc_areEqual; // true
</sqf>


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

Latest revision as of 23: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