PDA

View Full Version : unterminated string error - but why?


dunkel3d
06-09-2003, 01:39 AM
Hello, this UI makes a simple window

textFieldGrp
checkBox
optionMenuGrp
4 textScrollList panels
textFieldGrp
okButton
reloadButton
cancelButton

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:)



Thanks,
Keller Goal

mark_wilkins
06-09-2003, 01:47 AM
what error message?

-- Mark

dunkel3d
06-09-2003, 02:22 AM
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

mark_wilkins
06-09-2003, 02:28 AM
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 \n 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\n" +
"this is line 2\n" +
"this is line 3")


instead of


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


-- Mark

dunkel3d
06-09-2003, 02:58 AM
You are absolutely right, Mark. Pages 33, 133-134 give ample info on the topic.

It was my oversight.

Thanks again,
Keller Goal

CGTalk Moderation
01-15-2006, 09:00 AM
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.