Command: reorder

Syntax

reorder <ident>,<order>

Description

Re-order the elements of an array identifier.

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.

There must not be more numeric values in <order> than there are elements in <ident>. Element indices must occur only once within <order>. If there are less numeric values in <order> than there are elements in <ident> then the <ident> array gets truncated to the lower size.

Examples

Re-order all elements of an identifier. After execution, xar values are 30,40,10,20.

numeric xar[] = <10,20,30,40>
numeric ord[] = <3,4,1,2>
reorder xar,ord

Reorder an array range. After execution ss values are 'A','C','E','B','D'.

string ss[] = <'A','B','C','D','E'>
reorder ss[2:5],<2,4,1,3>

See Also

Commands:

circulate, reverse, sortid