Espresion Error

Hi

global proc addthistoexp()
{
string $getmyname="HelpMaya";
expression -s "print \""+$getmyname+"\";" -o "" -ae 1 -uc all ;
}
addthistoexp

can anyone tell whats wrong with this plz

is it not posible to use a varioble in expresion ???

reds

o.S.k

hey,
yeah, you can add variables, you just have to create a seperate string for your expression and then use that after your -s flag. like this:

global proc addthistoexp()
{
string $getmyname="HelpMaya";
string $newexpression = "print \""+$getmyname+"\";";
expression -s $newexpression -o "" -ae 1 -uc all ;
}
addthistoexp;

not quite sure why it is that way, but I find it's good practice to put anything thats being flaged with complicated syntax into a seperate string.
hope that helps!
Jason

Well no theres one pait of ()'s missing

global proc addthistoexp()
{
string $getmyname="HelpMaya";
expression -s ("print \""+$getmyname+"\";" ) -o "" -ae 1 -uc all ;
}

this makes the strigs concatenate ito one string before assignation its the same logic asto why

print "hey"+"ho";

dont work but

print ("hey"+"ho");

does

Hi Jooja

Thx its thts the prob

thx for your great help

and Jason also

regds

o.S.k