circulate <ident>,<index>
Re-order the elements of an array identifier in a circular fashion.
<ident>
An existing identifier. This should be an array.
<index>
A numeric value indicating which element of <ident>
is to be copied first.
None
Some system identifiers are read-only and as such cannot be re-ordered.
If an array specification is appended to <ident>, then only the indicated array elements will be re-ordered.
Circulate the elements of a numeric array starting at the 4th element.
numeric xar[] = <1,2,3,4,5,6,7,8,9,0> circulate xar,4
After execution, xar values will be 4,5,6,7,8,9,0,1,2,3.
Reorder an array range. After execution ss values are 'A','C','E','B','D'.
string ss[] = <'A','B','C','D','E','F'> circulate ss[2:5],3
After execution, ss values will be 'A','D','E','B','C','F'.
Commands: |