View Full Version : questions about double quotation marks
NeroBlack 10-27-2009, 09:41 AM Hello everyone!
i have a problem with double quotation marks.i want write a MEL to create a Expression on
a model,and wrote these:
string $slee[] = `ls -sl`;
expression -s
"
setAttr -type "string" textForBevel1.text "Maya";
"
-o ($slee[0]) -ae 1 -uc all ;
but it seemed that " can`t run like that .so how can i write these MEL include "" in a ""?
|
|
berniebernie
10-27-2009, 10:28 AM
Hello everyone!
i have a problem with double quotation marks.i want write a MEL to create a Expression on
a model,and wrote these:
string $slee[] = `ls -sl`;
expression -s
"
setAttr -type "string" textForBevel1.text "Maya";
"
-o ($slee[0]) -ae 1 -uc all ;
but it seemed that " can`t run like that .so how can i write these MEL include "" in a ""?
escape your " with backslashes setAttr -type \"string\" textForBevel1.text \"Maya\";
NeroBlack
10-28-2009, 02:29 AM
escape your " with backslashes setAttr -type \"string\" textForBevel1.text \"Maya\";
i run
string $slee[] = `ls -sl`;
expression -s
"
setAttr -type \"string\" textForBevel1.text \"Maya\";
"
-o ($slee[0]) -ae 1 -uc all ;
it returns
// Error: " //
// Error: Unterminated string. //
:curious:
Fumetsu
10-28-2009, 02:43 AM
setAttr -type \"string\"
Hello,
I don't think you should include the backslashes there. Try this:
setAttr -type "string" textForBevel1.text "\"Maya\"";
Edit: Edited to make some changes
berniebernie
10-28-2009, 02:45 AM
it works as a one liner
string $slee[] = `ls -sl`;
expression -s "setAttr -type \"string\" textForBevel1.text \"Maya\";" -o ($slee[0]) -ae 1 -uc all ;
(or at least an expression gets written)
jaydru
10-28-2009, 10:05 AM
if you want to break the string over a few lines then use an escape character at the end of each line
string $slee[] = `ls -sl`;
expression -s
"\
setAttr -type \"string\" textForBevel1.text \"Maya\";\
"
NeroBlack
10-30-2009, 12:44 AM
it works as a one liner
string $slee[] = `ls -sl`;
expression -s "setAttr -type \"string\" textForBevel1.text \"Maya\";" -o ($slee[0]) -ae 1 -uc all ;
(or at least an expression gets written)
thank you very much berniebernie!that`s so helpful!:cool:
NeroBlack
10-30-2009, 12:47 AM
if you want to break the string over a few lines then use an escape character at the end of each line
string $slee[] = `ls -sl`;
expression -s
"\
setAttr -type \"string\" textForBevel1.text \"Maya\";\
"
thank U jaydru!
it means i could write lot of lines of expression in the MEL,so interesting!:beer:
NeroBlack
10-30-2009, 05:22 AM
if you want to break the string over a few lines then use an escape character at the end of each line
string $slee[] = `ls -sl`;
expression -s
"\
setAttr -type \"string\" textForBevel1.text \"Maya\";\
"
i run this:
string $slee[] = `ls -sl`;
expression -s
"\
int $counter = 101 - time;
setAttr -type \"string\" textForBevel1.text int $counter;\
"
it returns
// Error: "\ //
// Error: Unterminated string. //
oh i`m crasy T T...
NeroBlack
10-30-2009, 06:39 AM
ok i got it!
string $slee[] = `ls -sl`;
expression -s
"int $counter = 101 - time;\r\setAttr -type \"string\" textForBevel1.text $counter;"
jaydru
11-01-2009, 02:38 AM
i run this:
string $slee[] = `ls -sl`;
expression -s
"\
int $counter = 101 - time;
setAttr -type \"string\" textForBevel1.text int $counter;\
"
it returns
// Error: "\ //
// Error: Unterminated string. //
oh i`m crasy T T...
like i said use an escape character at the end of EACH LINE, you didnt do this
string $slee[] = `ls -sl`;
expression -s
"\
int $counter = 101 - time;\ <--- you forgot this one
setAttr -type \"string\" textForBevel1.text int $counter;\
"
CGTalk Moderation
11-01-2009, 02:38 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.
vBulletin v3.0.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.