Using dimension labels programmatically / dynamically in a loop

Apologies if this has been asked before but I can't find it by googling:

Is there any way to use dimension labels in a programmatic or dynamic way?

For example, I want to do

// ...
variable i=0
do
   string thisLabel = stringFromList(i, listOfLabels)
    labelledWave[%thisLabel]
    i += 1
while (i < 10)


... but this considers 'thisLabel' as the label. Adding $ or similar didn't work for me. Thanks in advance.
Turns out I was making a simple mistake! (which wasn't even visible in my example) Here is the solution:

// ...
variable i=0
do
   string thisLabel = stringFromList(i, listOfLabels)
    labelledWave[%$thisLabel]
    i += 1
while (i < 10)


(The % needs to be between the [ ], not within the string thisLabel)
It should work this way ( %$ is the key to success ):

function testing()
variable i=0
make /O /N=3 labelledWave
string listOfLabels="a;b;c;"
do
   string thisLabel = stringFromList(i, listOfLabels)
   SetDimLabel 0, i, $thislabel, labelledWave
    labelledWave[%$thisLabel]=42+i
    print labelledWave[%$thisLabel]
    i += 1
while (i < 3)
end


HJ