faqts : Computers : Programming : Languages : Asp : ASP/VBScript : Language and Syntax

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

213 of 229 people (93%) answered Yes
Recently 9 of 10 people (90%) answered Yes

Entry

What is the different between Do..While .. Loop and While ... Wend

Jul 13th, 2000 22:25
unknown unknown, Bruce Anwyl


Do While has the following syntax and allows you to code a pre-test and
post-test loop. It also allows you the option to exit from the loop 
before the loop test condition becomes true.
Do [{While | Until} condition]
    [statements]
    [Exit Do]
    [statements]
Loop
Or, you can use this syntax:
Do
    [statements]
    [Exit Do]
    [statements]
Loop [{While | Until} condition]
Do Until is essentially the same thing except that the logic for the
condition is reversed.
The While Wend syntax only allows a pre test loop and does not allow you 
to make an early exit from the loop.
While condition
   [statements]
Wend



© 1999-2004 Synop Pty Ltd