isequal( param1, param2 )
Parameters
| Type | Description | |
| param1 | expression | first value to compare |
| param2 | expression | second value to compare |
_result
Set to a boolean value that specifies if param1 and param2 have the same values.
Descriptions
Compares both the root value and all array and property elements of param1 and param2. If param1 and param2 have the same root value, property values, and array values _result is set to true. If any values are different or if a property or array element exists on one parameter but not the other, _result is set to false. Isequal performs a deep comparison, meaning nested array and property elements are also compared. String comparisons are case sensitive. For case insensitive string comparisons, use the stricmp command.
In the example code below, the first call to isequal sets _result to false because the property names on the two variables are not the same (even though they have the same value). The second call to isequal sets _result to true because both variables have the same root value, property names, and property values.
If param1 and param2 have no property or array elements, the
isequal command has the same behavior as the
== operator. Since
isequal is a command, it
can not be used in an expression like operator == and must appear on a line by itself. After
calling isequal, the _result variable may be used in an expression.
See Also
copy, assignment (=), initialize, clear, cleararray, countarray, setarraycount, clearprops, hasprop, countprops, getpropname, user variables