title: c# while loop to finish current loop before ending
body: <p>I have a do while loop in my code and I am having it do about 30 lines of code each time within the loop. When it hits the while statement eg. it continues until ESC is pressed, Im not sure but will it complete the current loop or just up to the point where till the button is pressed? Because if all the code in the loop doesnt complete then the file it creates will be corrupted...</p>
  
  <p>So does it complete the current loop, if not how can I make it so the while loop will allow it to complete before exiting?</p>