BIS fnc areEqual: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (1 revision)
(Page filling)
Line 8: Line 8:
____________________________________________________________________________________________
____________________________________________________________________________________________


| <pre>
| 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 />
/************************************************************
<br />
Are Equal
'''NOTES:'''
 
* This function is an improvement over the {{=}}{{=}} operator, because it can handle any data type in any combination.
Parameters: [anything1, anything2, anything3, ...]
* 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.
Two or more elements can be passed.
* '''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. |= Description
 
This returns true if all of the passed data elements are of the same
type and value.
 
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.
 
************************************************************/
 
</pre><small>''(Placeholder description extracted from the function header by [[BIS_fnc_exportFunctionsToWiki]])''</small> |= Description
____________________________________________________________________________________________
____________________________________________________________________________________________


| <!-- [] call [[BIS_fnc_areEqual]]; --> |= Syntax
| [anything1, anything2, …] call [[BIS_fnc_areEqual]] |= Syntax


|p1= |= Parameter 1
|p1= anythings: [[Anything]] - any type of value: [[Array]], [[Boolean]], [[Code]], [[Control]], [[Config]], [[Group]], [[Number]], [[Script]], [[Object]], [[Display]], [[Side]], [[Text]] |= Parameter 1


| |= Return value
| [[Boolean]] |= Return value
____________________________________________________________________________________________
____________________________________________________________________________________________


|x1= <code></code> |=  
|x1= <code>[0, "0"] [[call]] [[BIS_fnc_areEqual]]; {{codecomment|// false}}
[0, 1 + 1 - 2] [[call]] [[BIS_fnc_areEqual]]; {{codecomment|// true}}
<nowiki>[</nowiki>[[str]] 50, "50"] [[call]] [[BIS_fnc_areEqual]]; {{codecomment|// true}}</code> |= Example 1
____________________________________________________________________________________________
____________________________________________________________________________________________


| |= See also
| [[isEqualTo]], [[BIS_fnc_areEqualNotNil]] |= See also
 
}}
}}



Revision as of 10:07, 22 April 2018


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.

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:
Uncategorised

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

Notes

Bottom Section