array()

Read(427) Label: array,

Here’s how to use array() function.

r .array()

Description:

Get the field values from a record sequentially and return them as a sequence.

Syntax:

r.array(Fi,…)

Note:

The function gets the values of Fi,… fields of the record r in order and returns them as a sequence. Get all the field values when parameter Fi is omitted.

Parameters

r

A record

Fi

Field name

Return value

A sequence

Example

 

A

 

1

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

 

2

=A1(1).array()

3

=A1(1).array(STUDENTID,SCORE)

[1,84]

 

P.array()

Description:

Transform each record of a table sequence/record sequence and return a sequence of sequences.

Syntax:

P.array()

Note:

The function transforms each record of table sequence/record sequence P into a sequence, where each member is also a sequence made up of a record’s field values. The return value type is a sequence of sequences.

Parameters:

P

A table sequence/record sequence

Return value:

A sequence of sequences

Example:

 

A

 

1

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

Return a table sequence

2

=A1.array()

Return a sequence of sequences