I see a few issues.
Line 2
the variable isn't defined with a datatype. Int datatype is appropriate here.
On line 7,
Code:
$namestring = "extrudedSurface",$name;
looks like bad syntax so I'm sure that will error out. I'm guessing you want $name to count upwards from 36 for each loop executed and use it as a suffix for "extrudedSurface". In that case, line 7 should be.
Code:
$namestring = ("extrudedSurface" + $name);
The rename statement doesn't have a semi colon and you didn't give the rename command anything to work with really.
It should more like...
Code:
rename $namestring $newName;