In the specific case of a while loop a shift register or a feedback node would be what you want. Either click on the side of the loop border and select Add Shift Register, or drop a feedback node (from the structures palette) in the loop. They do exactly wat you want.
___________________
Try to take over the world!