Here’s how to use A() function.
Description:
Get a member from a sequence.
Syntax:
A(i)
Note:
Get the ith member from the sequence A.
Parameter:
A |
A sequence. |
i |
A member’s sequence number expression, which starts from 1. |
Return value:
Values of members in a sequence
Example:
|
A |
|
1 |
=[1,2,4] |
|
2 |
=A1(3) |
4 |
3 |
=["a","b"](1) |
"a" |
Get one or more child members from member sequences of a sequence:
|
A |
|
1 |
=file("emp.txt").cursor@w().fetch() |
Return a sequence of sequences: |
2 |
=A1.(~2) |
Get the 2nd member of each member sequence of A1’s sequence: |
3 |
=A1.([~(1),~2]) |
Get the 1st and 2nd members of each member sequence of A1’s sequence: |
4 |
=A1.groupc(~(3);[(~1),(~2)]) |
Perform computations on A1 and return the following result: |
Related functions:
Description:
Get members of a sequence according to the sequence numbers of members of an integer sequence to create a new sequence.
Syntax:
A(p)
Note:
Here are sequence A whose length is n and the integer sequence p whose length is m. Get members in p and use their values as sequence numbers to get members in A in order to generate a new sequence.
Parameter:
p |
An integer sequence; the range of its member values is ≥0 and ≤n. If P is an empty sequence, then return an empty sequence. |
A |
A sequence whose length is n. |
Return value:
Sequence
Example:
|
A |
|
1 |
[a,b,c,d,e,f,g] |
|
2 |
[1,3,5] |
|
3 |
=A1(A2) |
[a,c,e] |
4 |
[1,3,5,10] |
|
5 |
=A1(A4) |
Report errors, as the index is out-of-bound. |
6 |
=A1([]) |
[] |
7 |
=A1([1,2,3,3]) |
[a,b,c,c] |
Related function: