Sfairadora

  • Reference Guide

remove

remove(seq, pos, n)
remove(seq, pos, n, var_seq2)
var_seq <- remove(pos, n)
var_seq <- remove(pos, n, var_seq2)
Removes n elements from a sequence beginning with the index pos. If the parameter var_seq2 is specified, it is a variable to which the values of removed elements are stored. The first two variants remove the elements form the sequence seq; the parameter itself is, however, left unchanged. The modified sequence is returned as the function result. The other two variants change the value of the variable or data item var_seq.

Parameters

seq
The sequence to be modified.
var_seq
An l-value of a sequence type, the value of which is to be changed.
pos
The position, from which to remove elements (the type Int). The index 0 denotes the beginning of the sequence. If the position is negative or beyond the sequence size, an error is returned.
n
The number of elements to be removed. If less then n elements remain, all remaining elements are removed.
var_seq2
An l-value of the same type as the sequence. Here, the values of the removed elements are stored.

Return Value

The first two variants return the modified sequence, which is of the same type as the parameter seq.
The other two variants return l-value referring to the variable var_seq.

See Also