Changes

Jump to navigation Jump to search
No change in size ,  11:14, 21 November 2023
Reorder array:put and array:remove
|}
==array:sizeput==
{| width='100%'
| width='120' | '''Signature'''
|<pre>array:sizeput( $array as array(*),) $position as xs:integer, $member as item()*) as array(*)</pre>
|- valign="top"
| '''Summary'''
| Returns the number a copy of members in {{Code|$array}} with {{Code|$member}} replaced at the specified {{Code|$position}}. Note that because an Equivalent to <code>$array => array:remove($position) => array:insert-before($position, $member)</code>.|- valign="top"| '''Errors'''|{{Error|FOAY0001|#Errors}} {{Code|$position}} is an item, not in the range {{Code|fn:count1}} function when applied to an array always returns {{Code|1array:size($array)}}inclusive.
|- valign="top"
| '''Examples'''
|
* <code>array:sizeput(array { 1 to 10 }["a", "b", "c"], 2, "d")</code> returns the array {{Code|10}}.* <code>array:size([1 to 10"a", "d", "c"])</code> returns {{Code|1}}, because the array contains a single sequence with 10 integers.
|}
==array:subarrayremove==
{| width='100%'
| width='120' | '''Signature'''
|<pre>array:subarrayremove( $array as array(*), $position positions as xs:integer, $length as xs:integer := ()*
) as array(*)</pre>
|- valign="top"
| '''Summary'''
| Constructs Returns a new array with with {{Code|$length}} members copy of {{Code|$array}} beginning from without the member at the specified {{Code|$position}}.<br/>The two-argument version of the function returns the same result as the three-argument version when called with {{Code|$length}} equal to the value of {{Code|array:size($array) - $position + 1positions}}.
|- valign="top"
| '''Errors'''
|{{Error|FOAY0001|#Errors}} {{Code|$A position}} is less than one, or if not in the range {{Code|$position + $length1}} is greater than to {{Code|array:size($array) + 1}}.<br/>{{Error|FOAY0002|#Errors}} {{Code|$length}} is less than zeroinclusive.
|- valign="top"
| '''Examples'''
|
* <code>array:subarrayappend(["a", "b", "c"], 21)</code> returns the array {{Code|["b", "c"]}}.
|}
==array:putsize==
{| width='100%'
| width='120' | '''Signature'''
|<pre>array:putsize( $array as array(*), $position ) as xs:integer, $member as item()*) as array(*)</pre>
|- valign="top"
| '''Summary'''
| Returns a copy the number of members in {{Code|$array}} with {{Code|$member}} replaced at the specified {{Code|$position}}. Equivalent to <code>$Note that because an array => array:remove($position) => array:insert-before($positionis an item, $member)</code>.|- valign="top"| '''Errors'''|{{Error|FOAY0001|#Errors}} {{Code|$position}} is not in the range {{Code|1fn:count}} function when applied to an array always returns {{Code|array:size($array)1}} inclusive.
|- valign="top"
| '''Examples'''
|
* <code>array:putsize(array { 1 to 10 })</code> returns {{Code|10}}.* <code>array:size(["a", "b", "c"1 to 10], 2, "d")</code> returns the array {{Code|["a", "d", "c"]1}}, because the array contains a single sequence with 10 integers.
|}
==array:removesubarray==
{| width='100%'
| width='120' | '''Signature'''
|<pre>array:removesubarray( $array as array(*), $positions position as xs:integer*, $length as xs:integer := ()
) as array(*)</pre>
|- valign="top"
| '''Summary'''
| Returns Constructs a copy new array with with {{Code|$length}} members of {{Code|$array}} without beginning from the specified {{Code|$position}}.<br/>The two-argument version of the function returns the same result as the member at three-argument version when called with {{Code|$length}} equal to the specified value of {{Code|array:size($array) - $positionsposition + 1}}.
|- valign="top"
| '''Errors'''
|{{Error|FOAY0001|#Errors}} A {{Code|$position }} is not in the range less than one, or if {{Code|1$position + $length}} to is greater than {{Code|array:size($array)+ 1}} inclusive.<br/>{{Error|FOAY0002|#Errors}} {{Code|$length}} is less than zero.
|- valign="top"
| '''Examples'''
|
* <code>array:appendsubarray(["a", "b", "c"], 12)</code> returns the array {{Code|["b", "c"]}}.
|}
administrator, Bureaucrats, editor, reviewer, Administrators
57

edits

Navigation menu