StringByKey stupid syntax problem

Simple question, but the solution is apparently so obvious that I can't see it. Am trying to write a very simple hook that will eventually set variables whenever the cursor is moved on the graph of a multidimensional wave, but my use of StringByKey is giving me errors. What am I doing wrong here?
function cursormovedhook(info)
    string info
    print xcsr(stringbykey("cursor", info))
end

I get errors telling me that I'm missing a right parenthesis. I know the hook is no longer the recommended way to do things, but I was expecting that it would be a quick fix.

Nathan
function cursormovedhook(info)
    string info
    print xcsr($stringbykey("cursor", info))
end


compiles here fine. xcsr is expecting a real string and not a string variable.
Quote:
xcsr is expecting a real string and not a string variable.


It's actually expecting a name, not a string. $ turns a string into a name. For example:
Make jack=sin(x/8), joe=cos(x/8)
Display jack    // jack is a name
String aString = "joe"
AppendToGraph aString   // Wrong - AppendToGraph will look for a wave named aString
AppendToGraph $aString  // OK - $aString returns a name taken from the contents of aString


For details:
DisplayHelpTopic "Converting a String into a Reference Using $"

Thanks for the solution, folks. I didn't realise that it was expecting a string reference rather than a string. Thanks again!
Nathan