I am loading a number of variables from a text file:
news1
news2
news3
...
I want to cycle through them to manipulate their values until I get to the last defined variable (so I can put as many variables in the text file as I please. I've tried using a for loop, but I think I've got the wrong syntax:
for (i = 1; ["news" + i] != undefined; i = i + 1 ){
<manipulation steps here>
}
Any ideas?
Thanks!
drewson
news1
news2
news3
...
I want to cycle through them to manipulate their values until I get to the last defined variable (so I can put as many variables in the text file as I please. I've tried using a for loop, but I think I've got the wrong syntax:
for (i = 1; ["news" + i] != undefined; i = i + 1 ){
<manipulation steps here>
}
Any ideas?
Thanks!
drewson