Name
While . . . Wend Statement
Syntax
Whilecondition
[statements
] Wend
-
condition
Use: Required
Data Subtype: Boolean
An expression evaluating to
True
orFalse
.-
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
Null
condition is evaluated asFalse
.If
condition
evaluates toTrue
, the program code between theWhile
andWend
statements is executed. After theWend
statement is executed, control is passed back up to theWhile
statement, wherecondition
is evaluated again. Whencondition
evaluates toFalse
, program execution skips to the first statement following theWend
statement.You can nest
While...Wend
loops 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 |
Get VBScript in a Nutshell now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.