Structure element as path input to NewPath operation

The compiler throws an error ("Expected a keyword or an object name") when a structure string element is used to input the path to NewPath:

Struct structJTG_MFLa s
NewPath /O/Q/Z spLoadNoteFunc, s.sPathToFiles

The error highlights the period between "s" and "sPathToFiles".

The structure and sPathToFiles have previously been defined as:

Structure structJTG_MFLa
    String sFileNameList        //semicolon separated list of selected files
    String sPathToFiles     //colon separated path to disk files
    Variable vKillWaves //1 == kill waves, otherwise don't; message to file loader to kill waves when done

This can be worked around with...

String sPathToFiles = s.sPathToFiles
//create new symbolic path 
NewPath /O/Q/Z spLoadNoteFunc, sPathToFiles

but the error from the use of a structure element is unexpected (for me, at least). Am I missing something?


Try using the following statement instead:
NewPath /O/Q/Z spLoadNoteFunc, ""+ s.sPathToFiles

The Igor compiler often has difficulties compiling operations that expect string parameters when you use a string element of a structure. By concatenating an empty string to the beginning of the structure string field, you allow the compiler to recognize that you are in fact providing a string.
This works. Now that I see the answer, I think it has been mentioned here (or on the mailing list) relatively recently. Thanks.