Reverse

new to Analytica 5.0

Release:

 • 4.6 •  5.0 •  5.1 •  5.2 •  5.3 •  5.4 •   •  6.0 •  6.1 •  6.2 •  6.3 •  6.4 •  6.5 •  6.6 •  7.0

Reverse( x, I, posFirst, posLast)

Reverses the items in array «x» along index «I». The result is still indexed by «I».

Use the optional «posFirst» and «posLast» to reverse the order of a sub-sequence along «I».

Examples

Suppose

Index J := 1..6
Variable a := J^2
Reverse(a,J) → Array(J, [ 36, 25, 16, 9, 4, 1 ])
Reverse(a,J,posFirst:3) → Array(J, [ 1,4, 36, 25, 16, 9 ])
Reverse(a,J,posLast:4) → Array(J, [ 16, 9, 4, 1, 25, 36 ])
Reverse(a,J,posFirst:3, posLast:5) → Array(J, [ 1, 4, 25, 16, 9, 36 ])

Notes

  • Reverse(x,I) is equivalent to x[@I=IndexLength(I)+1-@I]and x[-@I=@I].

See also

Comments


You are not allowed to post comments.