Command: circulate

Syntax

circulate <ident>,<index>

Description

Re-order the elements of an array identifier in a circular fashion.

Parameters

Switches

None

Notes

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.

Examples

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'.

See Also

Commands:

reorder, reverse, sortid