2. The Visual Basic Language
Visual Basic Counting
- Counting is accomplished using the For/Next loop.
Example
For I = 1 to 50 Step 2
Next I
In this example, the variable I initializes at 1 and, with each
iteration of the For/Next loop, is incremented by 2 (Step).
This looping continues until I becomes greater than or equal to its
final value (50). If Step is not included, the default value is 1.
Negative values of Step are allowed.
- You may exit a For/Next loop using an Exit For statement.
This will transfer program control to the statement following the
Next statement.
Counter Hit
This Homepage is special brought to you by CK Tan