Changes

Jump to: navigation, search

Visual Basic For Loops

386 bytes added, 18:01, 6 August 2007
Creating a Visual Basic For Loop
...''VB Statements''...<br>
'''Next''' ''counterVariable''<br>
 
The easiest way to gain an understanding of For loops is to see an example. The following code excerpt declares a variable to act as the loop counter and the performs a loop 5 times, displaying the value of the counter on each loop iteration:
 
<pre>
Dim intCount As Integer
 
For intCount = 0 To 5
MessageBox.Show("Counter is currently: " + CStr(intCount))
Next intCount
</pre>

Navigation menu