Get the App
SLTechnology News&Howtos  ›  Development  › 

The usage of While...Wend statement in VBS

Shulou Source: shulou.com Published: 2022-06-03 19:40:26 11月12日 Update

This article mainly explains "the usage of While...Wend sentence in VBS". The content of the explanation in this article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn the usage of While...Wend sentence in VBS.

When the specified condition is True, a series of statements are executed.

While condition

& nbsp; Version [statements]

Wend

Parameter condition

A 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 when the condition is True.

Description

If condition is True, all statements before the Wend statement in the statements will be executed, then control will be returned to the While statement, and the condition will be rechecked. If condition is still True, repeat the above process. If not True, the program continues to execute from the statement after the Wend statement.

A While...Wend loop can be a multi-layer nested structure. Each Wend corresponds to the most recent While statement.

Note that the Do...Loop statement provides a more structured and adaptive way to execute the loop.

The following example illustrates how to use the While...Wend statement:

Dim CounterCounter = 0 'initializes the variable. While Counter < 20 'test the value of the counter. Counter = Counter + 1 'increments the counter. The Alert CounterWend 'counter is greater than 19:00 to end the loop. Thank you for reading, the above is the content of "the usage of While...Wend sentence in VBS". After the study of this article, I believe you have a deeper understanding of the usage of While...Wend sentence in VBS, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Tags: Statements counters learning loops content conditions structures examples parameters variables multiple layers multiple characters strings that is ideas situations control rights numerical values articles Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Xiaomi Microsoft MariaDB NVidia Huawei