Page tree
Skip to end of metadata
Go to start of metadata




Introduced in

Version:1.19

Description

Description:Returns true if all of the passed data elements are of the same type and value. This function can safely compare all data types, even if the data types are mixed or nil.

Syntax

Syntax:comparelist call fn_vbs_areEqual
Parameters:
Return Value:Boolean

Warning

When using functions in VBS versions older than 3.4, certain limitations and requirements should be kept in mind - the main ones being that capitalization of the function name is crucial, and that #include "\vbs2\headers\function_library.hpp" has to be included in every script that utilizes it. More Category VBS Scripting Functions.

Examples

Examples:
_isEqual = [[1,2,3],[1,2,4]] call fn_vbs_areEqual

Additional Information

See also: fn vbs arrayCompare
Multiplayer: 
Problems: 

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 all arrays hold the same elements in the same order.

-If all 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.