Determine if two arrays are equals.
1 array.equals
<array.equals name='name'>
<array 1 /> +
<array 2 /> +
</array.equals>
Attributes | |||||
---|---|---|---|---|---|
Name | Type | Required | Default | Description | |
Aname | string | Name of the variable of array type. |
Arguments | |||||
---|---|---|---|---|---|
Name | Type | Required | Unique | Nullable | Description |
Earray 1 | array | First of the two array objects that will be compared. | |||
Earray 2 | array | Second of the two array objects that will be compared. |
Returns | |
---|---|
Type | Description |
Boolean | Returns true if the two arrays are equal; false otherwise. |
Example
Determine if the two arrays are equal.
Copy
<xsql-script name='array_equals'> <body> <set name='cities'> <array> <string>Avila</string> <string>Barcelona</string> <string>Cádiz</string> </array> </set> <set name='cities_repeated'> <array> <string>Avila</string> <string>Barcelona</string> <string>Cádiz</string> </array> </set> <println> <array.equals name= 'a'> <cities/> <cities_repeated/> </array.equals> </println> </body> </xsql-script>
Shows the following result:
Copy
true
Example
Determine of two different arrays are equals.
Copy
<xsql-script name='array_equals'> <body> <set name='cities'> <array> <string>Avila</string> <string>Barcelona</string> <string>Cádiz</string> </array> </set> <set name='countries'> <array> <string>España</string> <string>Francia</string> <string>Portugal</string> </array> </set> <println> <array.equals name= 'a'> <cities/> <countries/> </array.equals> </println> </body> </xsql-script>
Shows the following result:
Copy
false