Any One Explain?

hello

i have a querie. im creating (trying) a ik fk setup script. i am a beginner at mel so hope this is not too rookie.

im trying to setup the naming part of the script. so i thought of something like this (thanks 2 gentlesea found this on another post and it helped me iron out some syntax errors i had)

string $suffix = "_ik"
string $sel[] = ls -sl -dag;

for ($every in $sel)
{
rename $every ($every + $suffix);

}

but i keep getting errors
// Error: string $sel[] = ls -sl -dag; //
// Error: Line 2.6: Syntax error //
// Error: for ($every in $sel) //
// Error: Line 4.20: "$sel" is an undeclared variable. //
// Error: rename $every ($every + $suffix); //
// Error: Line 6.15: "$every" is an undeclared variable. //
// Error: rename $every ($every + $suffix); //
// Error: Line 6.23: "$every" is an undeclared variable. //

but if i put them in a global proc and have the I input the suffix it works!!

global proc addSuffix (string $suffix)
{
select -hierarchy ArmJA_1;
string $sel[] = ls -sl -dag;
for ($every in $sel)
{
rename $every ($every + $suffix);

}
}

any one help? i wanna put it in a proc to be called but i dont eana have to manually type the input.

i really want to uderstand these fundamentals quickly

thanks for any help (again sorry if this is obvious)

If this is the code character per character, than you simply are missing a semicolon ( after your "string $suffix = "_ik";" line (2.6)

thanks

sorry for that. shouldnt need to have my code checked like that.
i hang my head in shame!

thanks for the reply. i got it workinhg now

cheers