mystring=textwave[index] wont compile - help

Hi,
I am sure this is trivial for you guys but I just cant get Igor to compile this function (see below).
The wave "group_list" is created by another function (so it exists at the time of compiling) - still I keep getting the error that Igor "got "group_list" instead of a string variable..". If I make the wave in this function then it works. Still I'd like to access waves created by other functions (must be possible). Tried adding WAVE group_list but it doesnt help.
Whats am I doing wrong here? Please help. I would be grateful for any input. Thanks Stefan.

function getWaveIndex()
setdatafolder root:nm_folder0:
string mystring
mystring=group_list[0]
print "string=",mystring
end
Hi Stefan,

You have to declare that group_list is a text wave with the /T flag.
Then it works as in here:
function getWaveIndex()
setdatafolder root:nm_folder0:
Wave/T group_list
string mystring
mystring=group_list[0]
print "string=",mystring
end