It looks like you're new here. If you want to get involved, click one of these buttons!
$myArray to [0, 1, 2, 3, 4, 5], and I want to display this as follows:
<<for $i to 0; $i < $myArray.length; $i++>> <<print $myArray[$i]>> [[Pick this element|nextPassage][$foo to $myArray[$i]]] <</for>>
No matter which element you pick, the value of $foo will always be 5.0
Pick this element
1
Pick this element
...
5
Pick this element
Comments
This means that in your example the value of $i will always be equal to 6 ($myArray.length) which means that you are trying to assign $myArray[6] to $foo and that element does not exist.
You can use a <<print>> macro to dynamically create your Setter Link which allows to to use the correct value of $i with each link.
Thanks a bunch!