in reply to Filling in missing values in an array

The code I have written is below, but it doesn't appear to change anything.

Since there's nothing in the OP code snippet about getting input data, and nothing about outputting results, I have to ask: how do you know whether or not it's changing anything?

I'm also curious about the logic in the middle "while" loop. What's special about the $exposures[4] ? Given the surrounding code (even though it's incomplete) and the description of the problem, it's hard to imagine why one specific element of this array should be used in this way.

Replies are listed 'Best First'.
Re^2: Filling in missing values in an array
by dhuang90 (Initiate) on Jun 29, 2011 at 15:01 UTC
    Thanks everyone for the replies. It was very helpful in getting me to understand the logic behind this problem. I forgot to edit my code; $exposures4 was a mistake and the 4 should have been replaced with counter variables I didn't include the code to read in the file or print the output of the file, but I am reading in data from a .txt Once again, big thanks to zek152, Marshall,graff, Neighbour, and FunkyMonk!