Quantcast
Channel: Take Command / TCC
Viewing all articles
Browse latest Browse all 1742

When the array name is in a variable ...

$
0
0
When the name of an array is in a variable, manipulating the array is a little tricky. The help might benefit from an example. Here's a fairly simple one.

Code:
    :: swap ith and jth entries of the array
    :: whose name is in the variable aname
    set tmp=%[aname[%i]]
    set %aname[%i]=%[aname[%j]]
    set %aname[%j]=%tmp

Viewing all articles
Browse latest Browse all 1742

Trending Articles