As for the rest of the script, you used [i] in two places where it won’t work:
group[i].name = "P"+[i];
should be
group[i].name = "P"+i;
and
p[i].expression = "[0, effect('Pos-"[i]"')('Slider')];"
I’m guessing it should be (depending on what you named your Sliders):
p[i].expression = "[0, effect('Pos-"+i+"')('Slider')];"
Finally, compWidth and compHeight aren’t defined, but they might be global variables in some part of your code that you didn’t post.