A. modify()

Read(202) Label: specified position, assign, sequence,

Description:

Assign value(s) to one or more members of a sequence according to the specified position(s).

Syntax:

A.modify(k,x)

Assign x to the kth member of sequence A

A.modify(k,X)

Assign members of X to members of A in order from the kth position to the (k+|X|-1)th position

Note:

The function assigns x to the kth member of sequence A or members of X to the members of A from the kth position to the number (k+|X|-1)th position in order. Automatically update the index, if any, and check distinctness.

Parameters:

A

A sequence

k

A member position; If k is greater than the length of sequence A, then append the member in the end

x

A member value

X

A sequence

Options:

@n

Return the modified record or a record sequence of modified records

Return value:

A sequence

Example:

 

A

 

1

=["a","c","d","e","f"]

 

2

=A1. modify(2,"g")

[a,g,d,e,f]

3

=A1.modify(6,[2,4,5])

[a,g,d,e,f,2,4,5]; append the values at the end as the specified position execeeds the limit

4

=demo.query("select * from STUDENTS")

 

5

=A4.modify@n(2:3,ID+10:ID)

Return a record sequence of modified records

Related functions:

A.delete()

A.insert()

T.modify()