Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Do...While vs Do...Until

Status
Not open for further replies.

guitardave78

Programmer
Sep 5, 2001
1,294
0
0
GB
Hey all.
What, if any, is the main reason to use do while vs do until.

They seem to do the same thing, albeit from a different angle.

Do something while a condition is true or do something until a condition becomes true.

Is there a performance difference or is this just down to personal taste?

}...the bane of my life!
 
The flow control expression is tested AFTER the loop is executed at least once.

IMHO the few times when this actually leads to shorter code are not worth the lack of consistancy vs using Do While every time... The developers that follow you and maintain the code will be thankful if you always use the same technique.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top