BIS fnc areEqual: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - " <h3 style="display:none">Notes</h3> <dl class="command_description"> <!-- Note Section BEGIN --> <!-- Note Section END --> </dl>" to "") |
Lou Montana (talk | contribs) m (Text replacement - " *\| *([Cc]omments|COMMENTS|[Gg]ame [Nn]ame|Game [Vv]ersion|Game Version \(number surrounded by NO SPACES\)|Multiplayer Arguments \("local" or "global"\)|Multiplayer Effects \("local" or "global"\)|Multiplayer Execution \("server" o...) |
||
Line 1: | Line 1: | ||
{{Function | {{Function | ||
| arma2 | | arma2 | ||
|1.00 | |1.00 | ||
|gr1 = Variables | |gr1 = Variables | ||
| 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.<br> | | 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.<br> | ||
Line 13: | Line 13: | ||
* 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 (> 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. | * '''WARNING:''' 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. | ||
| [anything1, anything2, …] call [[BIS_fnc_areEqual]] | | [anything1, anything2, …] call [[BIS_fnc_areEqual]] | ||
|p1= anythings: [[Anything]] - any type of value: [[Array]], [[Boolean]], [[Code]], [[Control]], [[Config]], [[Group]], [[Number]], [[Script]], [[Object]], [[Display]], [[Side]], [[Text]] | |p1= anythings: [[Anything]] - any type of value: [[Array]], [[Boolean]], [[Code]], [[Control]], [[Config]], [[Group]], [[Number]], [[Script]], [[Object]], [[Display]], [[Side]], [[Text]] | ||
| [[Boolean]] | | [[Boolean]] | ||
|x1= <code>[0, "0"] [[call]] [[BIS_fnc_areEqual]]; {{codecomment|// false}} | |x1= <code>[0, "0"] [[call]] [[BIS_fnc_areEqual]]; {{codecomment|// false}} | ||
[0, 1 + 1 - 2] [[call]] [[BIS_fnc_areEqual]]; {{codecomment|// true}} | [0, 1 + 1 - 2] [[call]] [[BIS_fnc_areEqual]]; {{codecomment|// true}} | ||
<nowiki>[</nowiki>[[str]] 50, "50"] [[call]] [[BIS_fnc_areEqual]]; {{codecomment|// true}}</code> | <nowiki>[</nowiki>[[str]] 50, "50"] [[call]] [[BIS_fnc_areEqual]]; {{codecomment|// true}}</code> | ||
| [[isEqualTo]], [[BIS_fnc_areEqualNotNil]] | | [[isEqualTo]], [[BIS_fnc_areEqualNotNil]] | ||
}} | }} | ||
Revision as of 22:37, 17 January 2021
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.
NOTES:- 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.
- WARNING: 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.
- Execution:
- call
- Groups:
- Variables
Syntax
- Syntax:
- [anything1, anything2, …] call BIS_fnc_areEqual
- Parameters:
- anythings: Anything - any type of value: Array, Boolean, Code, Control, Config, Group, Number, Script, Object, Display, Side, Text
- 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:
- isEqualToBIS_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