Date: Jan 22, 2013 2:40 AM
Author: marco.scarnicchia@gmail.com
Subject: Help_FOR

Hi,
I have a problem with this code:

Exit[]
Nrighe = 2;
Parameters = {Subscript[\[Theta], i], Subscript[d, i],
Subscript[\[Alpha], i], Subscript[a, i]};
TabDH = Grid[Table[Parameters, {i, Nrighe}], Frame -> All]
Riga[1] = TabDH[[1]][[1]];
Riga[2] = TabDH[[1]][[2]];
TabDH[[1]][[1]] = {PopupMenu[
Dynamic[Subscript[\[Theta], 1]], {0, Subscript[q,
1], -2 Pi, -3 Pi/2, -Pi, -Pi/2, Pi/2, Pi, 3 Pi/2, 2 Pi}],
PopupMenu [
Dynamic[Subscript[d, 1]], {0, Subscript[l, 1], Subscript[q, 1]}],
PopupMenu [
Dynamic[Subscript[\[Alpha], 1]], {0, -2 Pi, -3 Pi/2, -Pi, -Pi/2,
Pi/2, Pi, 3 Pi/2, 2 Pi}],
PopupMenu [Dynamic[Subscript[a, 1]], {0, Subscript[h, 1]}]}
TabDH[[1]][[2]] = {PopupMenu[
Dynamic[Subscript[\[Theta], 2]], {0, Subscript[q,
2], -2 Pi, -3 Pi/2, -Pi, -Pi/2, Pi/2, Pi, 3 Pi/2, 2 Pi}],
PopupMenu [
Dynamic[Subscript[d, 2]], {0, Subscript[l, 2], Subscript[q, 2]}],
PopupMenu [
Dynamic[Subscript[\[Alpha], 2]], {0, -2 Pi, -3 Pi/2, -Pi, -Pi/2,
Pi/2, Pi, 3 Pi/2, 2 Pi}],
PopupMenu [Dynamic[Subscript[a, 2]], {0, Subscript[h, 2]}]}


I would like to simplify using a for loop but I can not. Someone could you help me out?

For[i = 1, i <= Length[Nrighe], i++,
Riga[i] = TabDH[[1]][[i]];
TabDH[[1]][[i]] = {PopupMenu[
Dynamic[Subscript[\[Theta], i]], {0, Subscript[q,
i], -2 Pi, -3 Pi/2, -Pi, -Pi/2, Pi/2, Pi, 3 Pi/2, 2 Pi}],
PopupMenu [
Dynamic[Subscript[d, i]], {0, Subscript[l, i], Subscript[q, i]}],
PopupMenu [
Dynamic[Subscript[\[Alpha], i]], {0, -2 Pi, -3 Pi/2, -Pi, -Pi/2,
Pi/2, Pi, 3 Pi/2, 2 Pi}],
PopupMenu [Dynamic[Subscript[a, i]], {0, Subscript[h, i]}]};
]

Thanks