# p()

Here’s how to use p() function.

## A .p()

Description:

Get sequence numbers of the members at specified positions.

Syntax:

 A.p(i) -n<=i<=n; 1<=i<=n indicates getting the sequence number of the ith member; -n<=i<=-1 indicates getting the sequence number of the ith member backwards. A.p(P) P is the n-integer sequence whose length is m. Its members should be greater than -n and less than n, but they should not be equal to 0.

Note:

A is a sequence whose length is n, from which you get sequence numbers of the members at specified positions. The function is generally used to get the sequence numbers of the members reversely.

Parameters:

 A A sequence object whose length is n i An integer P An n-integer sequence whose length is m

Options:

 @r Turn back if the specified position exceeds the boundary of A, that is, to set i=if(i%n==0,n,i%n), where n is the length of A. @0 The member represented by a sequence number that exceeds the boundary of A will be excluded from the result of A.p(P).

Return value:

An integer or an integer sequence composed of sequence numbers of members at specified positions in a sequence

Example:

 A 1 [a,b,c,d,e,f,g,h,i,j] 2 =A1.p(2) 2 3 =A1.p(-2) 9 4 =A1.p([2,3]) [2,3] 5 =A1.p([-2,-3]) [9,8] 6 =A1.p@0([5,12])  7 =A1.p@r([5,12]) [5,2]

Related functions: