statements, in addition to judging statements, there are circular statements, there are several forms:
1, while ... Wend statement. Grammar:
While condition
[Statements]
Wend
While ... The syntax for a Wend statement has the following sections:
Partial description
Condition necessary parameters. A numeric expression or string expression that evaluates to TRUE or False. If condition is Null, condition is treated as False.
Statements Optional parameters. One or more statements that are executed when the condition is true.
2, do ... The Loop statement. Grammar:
Do [{while | Until} condition]
[Statements]
[Exit do]
[Statements]
Loop
Or you can use the following syntax:
Todo
[Statements]
[Exit do]
[Statements]
Loop [{while | Until} condition]
The parameter descriptions in the syntax of DO Loop statements are the same as above and do not repeat.
3, for ... Next statement. Grammar:
For counter = start to end [step step]
[Statements]
[Exit for]
[Statements]
Next [counter]
For ..... The syntax for the NEXT statement has the following sections:
Partial description
Counter necessary parameters. A numeric variable used as a loop counter. This variable cannot be a Boolean or an array element.
The necessary parameters for start. The initial value of the counter.
End necessary parameter, counter final value.
Step optional parameter. The step size of the counter. If not specified, the default value for step is 1.
Statements Optional parameters. One or more statements that are placed between for and Next, and they are executed the specified number of times.
4. For Each ... Next statement. Grammar
For each element in group
[Statements]
[Exit for]
[Statements]
Next [element]
For ..... Each ... The syntax for the NEXT statement has the following sections:
Partial description
Element necessary parameters. A variable used to traverse a collection or all elements in an array. For a collection, the element may be a Variant variable, a generic object variable, or any special object variable. For an array, an element can only be a variant variable.
Group necessary parameters. The name of the object collection or array, except for an array of user-defined types.
Statements an optional parameter that executes one or more statements for each item in the group.