Deletes all the elements of a variable of the array type.
1 array.clear
<array.clear name='name'>
<array /> ?
</array.clear>
Attributes | |||||
---|---|---|---|---|---|
Name | Type | Required | Default | Description | |
Aname | string | Name of the variable of the array type. |
Arguments | |||||
---|---|---|---|---|---|
Name | Type | Required | Unique | Nullable | Description |
Earray | array | The array object can be referenced by name using the name attribute or can be passed as an argument of the function. |
Returns | |
---|---|
Type | Description |
array | Returns to the actualized list. |
Example
Delete all the elements of an array.
Copy
<xsql-script name='array_clear_test1'> <body> <array name='cities'> <string>Barcelona</string> <string>Paris</string> <string>Roma</string> </array> <array.clear name='cities' /> <println><cities /></println> </body> </xsql-script>
The content of the structure is deleted with this function, erasing all the elements which compose the array. Another way to empty the variable ‘cities’, would be: <array.clear ><cities/></array.clear>