serial input to arduino

You are the only one posting stuff like "If the while test found that there was serial data available, how can the delay make it go away?" Where did you get the idea that the delay would make the data go away?

I was pointing out that the only thing that happens between the two conditional tests was a delay statement. I've repeatedly said that the delay statement can not make the data go away. You are the one twisting my question around.

So, I will categorically state that the while test needs a >0 at the end AND that the if test is completely unnecessary.

Merry Christmas.