A.field(F,x)

Read(658) Label: modify, specified field value,

Description:

Modify the value of a specified field in a sequence.

Syntax:

A. field(F,x)

Note:

The function assigns members of sequence x sequentialy to values of Fth field in sequence A, or values of string parameter F. Count backward if F<0. Do not execute if F exceeds the boundary number of the fields or it does not exist.

Parameter:

A

A sequence

F

Ordinal number of a field, or the string parameter in which a variable can be used to reference the field name

x

A sequence whose length is equal to the number of values in Fth field, or a single value, which can be considered as a sequence in which members have the same value and their number is equal to the number of values in Fth field

Return value:

None

Example:  

 

A

 

1

=demo.query("select top 3 * from EMPLOYEE")

 

2

=A1.field(9,8000)

Modify the value of the ninth field; parameter x is a single value, and it will be regarded as the sequence [8000,8000,8000];

here’s A1’s result:

3

=A1.field("SALARY",7000)

Modify all values of SALARY field into 7000.

4

>arg1="SALARY"

 

5

=A1.field(arg1,7000)

Same as A3.

6

=A1.field(9,[8000,6500,9000])

Here parameter x is a sequence, and this is A1’s result:

Related function:

r.field(F)

A.field(F)

r.field(F,x)