Sorry for the wait, guys. Haven't been near a computer all weekend, but after some vigorous hand-debugging (I *REALLY* don't like doing that), i finally figured out the problem. Like I said in the original post, it was something very, VERY stupid. $starton is read from a text file containing lots of data, and I forgot to convert it to an integer. Like I said, stupid. I had briefly considered it before, but I threw it out, because in the loop before, I had $i>$starton, and because starton was 1, it ran once, and I didn't think twice about it.
BTW: the loop I first posted came as-is from my program, no examples.
Thanks a bunch to all those who came to my aid.
