FORUMS: list search recent posts

What's the problem with this script?

COW Forums : Autodesk Maya

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
Mostafa Talebi
What's the problem with this script?
on Jan 9, 2012 at 8:48:11 pm

I have written this script, but it reports error
Error://
Error: Syntax Error//



Have made me mad, whenever I write conditional statements it just goes to riddle with errors. How shall I solve this?
-------------------------------------------------------

string $meshNames[] = `ls -type "mesh"`;
if (`window -exists meshUI` == 1)
{
deleteUI meshUI;
}
window -title "meshMonitor" -maximizeButton 0 -minimizeButton 0 meshUI;
columnLayout -adj 1 mainL;
textScrollList -height 150 meshTSL;
for($eachItem in $meshNames[])
{
textScrollList -edit -append $eachItem meshTSL
}

showWindow meshUI;


Return to posts index

Steve Sayer
Re: What's the problem with this script?
on Jan 10, 2012 at 7:27:48 pm

The problem is with "for($eachItem in $meshNames[])".

You don't put the [] brackets every time you use an array variable. Only when you are first declaring it.

It also needs a semicolon at the end.

Finally, as a style tip, note that instead of typing "if (`window -exists meshUI` == 1)" you can probably just use "if (`window -exists meshUI`)". The '-exists' flag tends to return a 1 or a 0 anyway, which means you can skip the step of comparing it to something.

Hope that helps.


Return to posts index

Mostafa Talebi
Re: What's the problem with this script?
on Jan 10, 2012 at 7:30:31 pm

Thank you very much.


Return to posts index


Hamza Siddiqui
Re: What's the problem with this script?
on Jan 10, 2012 at 8:01:53 pm

Sorry that I cannot give you solution..I am also new in MAYA


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]