unterminated string error - but why?


Hello, this UI makes a simple window

4 textScrollList panels

upon clicking checkBox, the first textField and the okButton should dim. Otherwise, the optionMenuGrp should be disabled.

when I source the script, I get this error message referring to the checkBoxe’s -onCommand flag.

Could someone test it and give me some feedback on a possible solution:)

Keller Goal


what error message?

– Mark


Hi, Mark. Thanks for your reply:)

I get this message:

// Error: “C:/Program Files/AliasWavefront/Maya4.5/scripts/others/Win.mel” line 261.71: Unterminated string. //

weird considering my -onc flag was working fine when I executed the script from the script editor.

Keler Goal


Quoted strings can’t cross line boundaries.

If you have “MEL Scripting for Maya Animators,” this issue is discussed in the particle expressions chapter when building a large particle expression in a string so that it can be assigned with dynExpression.

The solution is to use string concatenation at line breaks… (use
if you actually want line breaks in the string you’re creating. If it doesn’t matter and you just want to break the string apart for readability, they’re not necessary.):

("this is line 1
" +
 "this is line 2
" +
 "this is line 3")

instead of

"this is line 1
 this is line 2
 this is line 3"

– Mark


You are absolutely right, Mark. Pages 33, 133-134 give ample info on the topic.

It was my oversight.

Thanks again,
Keller Goal


This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.