Serial problem

To make it better, this is the case:

In the first program, when I sent the data, the arduino was in 'delay' condition. But when the 'delay' condition was over, the data couldn't be processed.

In the second program, when I sent the data, the arduino was in 'delay' condition. But when the 'delay' condition was over, the data could be processed.
Why?