joncom Posted April 25, 2005 Posted April 25, 2005 Could someone please explain to me what the different is? They are both loops that run until the condition is met.... how do they differ?
SlimShady Posted April 25, 2005 Posted April 25, 2005 Could someone please explain to me what the different is? They are both loops that run until the condition is met.... how do they differ?<{POST_SNAPBACK}>They don't differ. Are you satisfied?
Valik Posted April 25, 2005 Posted April 25, 2005 Do...Until always runs the code at least once. It checks the condition after each run through the body of the loop. While...WEnd checks the condition before running the code, so its possible that the code may not execute if the condition isn't true at the start of the loop. Also, the While loop runs while a condition is true and stops when it is false. The Do loop runs while a condition is false and stops when the condition is true. For example: While 1 = 2 MsgBox(4096, "", "This will never print") WEnd Do MsgBox(4096, "", "This prints") Until 1 <> 2 And Slim, they are totally different. They must be thought of in different ways and are used in different ways, therefore, they are different. If they weren't different, they both wouldn't be present.
joncom Posted April 25, 2005 Author Posted April 25, 2005 Good answer, Valik! Crystal clear now, thanks!
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now