You are here: Symbol Reference > MtxVec Namespace > Classes > TVec Class > public > Rotate Method > TVec.Rotate Method (integer)
MtxVec VCL
ContentsIndex
PreviousUpNext
TVec.Rotate Method (integer)

A cyclic shift on vector elements.

Pascal
function Rotate(Offset: integer): TVec; overload;

Performs cyclic shift on vector elements. The number of elements to shift is specified in the Offset parameter. Offset can be any integer number, positive or negative.

var a: TVec; begin CreateIt(a); try a.SetIt(False,[1,2,3,4]); a.Rotate(2); // a = [3,4,1,2] finally FreeIt(a); end; end;
Examples on GitHub
Copyright (c) 1999-2025 by Dew Research. All rights reserved.
What do you think about this topic? Send feedback!