See also Suffering from Buffering.
In reply to Re: Printing inside a loop by Fletch in thread Printing inside a loop by no21