Message 1 of 10
While loops - syntax errors? <.<
Not applicable
10-05-2011
02:14 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Ok, so this is what I want:
seperating the string into an array with the stringToStringArray cmd (works fine)
then I want the size of that array to be stored as an int in a seperate var (works fine as well)
Then I want a while loop so that maya returns me prints for every element in the array.(doesnt work. Here's the lines:
MEL goes completely bananas and I have no clue why >_< I set the while loop up just as I would an IF function (which always work just fine) but somehow Mel keeps returning THREE syntax errors on the "while" line. Maybe I ddnt get enough sleep, maybe Im mentally handicapped, but I have no idea what on earth I messed up here.
So I beg you, tell me the obvious so I can facepalm myself to death. 😛
seperating the string into an array with the stringToStringArray cmd (works fine)
then I want the size of that array to be stored as an int in a seperate var (works fine as well)
Then I want a while loop so that maya returns me prints for every element in the array.(doesnt work. Here's the lines:
$gVar_ccN_spine = stringToStringArray($lVar_spineCtrlNames,";") ;
int $lVar_arraySize = `size $gVar_ccN_spine`; //write the size of the spineCtrl Array to a local variable named §lVar_arraySize
//----------------
//print check variables:
while ($counter=0; $counter <= $lVar_arraySize;$counter ++ )
{
print ("\n \n Updating $gVar_ccN_spine to:");
print $gVar_ccN_spine;
print "\n...done.";
}
MEL goes completely bananas and I have no clue why >_< I set the while loop up just as I would an IF function (which always work just fine) but somehow Mel keeps returning THREE syntax errors on the "while" line. Maybe I ddnt get enough sleep, maybe Im mentally handicapped, but I have no idea what on earth I messed up here.
So I beg you, tell me the obvious so I can facepalm myself to death. 😛