Name
While . . . Wend Statement
Syntax
Whilecondition[statements] Wend
-
condition Use: Required
Data Subtype: Boolean
An expression evaluating to
TrueorFalse.-
statements Use: Optional
Program statements to execute while condition remains
True.
Description
Repeatedly executes program code while a given condition remains
True.
Rules at a Glance
A
Nullcondition is evaluated asFalse.If
conditionevaluates toTrue, the program code between theWhileandWendstatements is executed. After theWendstatement is executed, control is passed back up to theWhilestatement, whereconditionis evaluated again. Whenconditionevaluates toFalse, program execution skips to the first statement following theWendstatement.You can nest
While...Wendloops within each other.
Programming Tips & Gotchas
The While...Wend statement remains in VBScript for
backward compatibility only. It has been superseded by the much more
flexible Do...Loop statement.
See Also
| Do . . . Loop Statement |
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access