I have two sections of code below. I would like to reference the array like I have it written in the first section of code. However that does not work. The second code works, but I would like to do it the other way. Is there something I am missing in the first section that causes the 'i' variable to not retain its value?
-------------------------------------