I would NOT recommend messing with the GetData and PutData functions. Calling them twice in a single main loop may cause you big problems. The correct solution to the problem is what has been previously posted which is to use an "if" statement. The only appropriate use of a while loop in this context is for iterating through a list of processor tasks. Example:
Code:
while (x < 7)
{
put (Math.pow(x, 2), table[x]);
x++;
//This is pseudocode (I forget the appropriate power function and I made up
// put (int, int[])
}