Promotic
WikipediaLinkedInYoutubeTwitterFacebook

While...Wend - statement of language VBScript

Description:
Executes a series of statements as long as a given condition is true.
Syntax:
While condition
  [statements]
Wend
 
condition Numeric or string expression that evaluates to true or false. If condition is Null, condition is treated as false.
statements One or more statements executed while condition is true.
Note:
If condition is true, all statements are executed until the Wend statement is encountered. Control then returns to the While statement and condition is again checked. If condition is still true, the process is repeated. If it is not true, execution resumes with the statement following the Wend statement.

While...Wend loops can be nested to any level. Each Wend matches the most recent While.

 
Tip: The Do...Loop statement provides a more structured and flexible way to perform looping.
See also:
Example:
Dim Counter
Counter = 0
While Counter < 20
  Counter = Counter + 1
  Pm.Debug "Counter=" & Counter
Wend
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice