|
|
 |
' Learn how to use a for loop.
' You should always use a for loop when the amount of repetitions is known.
Private Sub Form_Load()
'display the numbers from 0 to 9
For i = 0 To 9
Text1.Text = Text1.Text & i & ","
Next i
End Sub
' Let us take a closer look at our for loop:
'----------------------------------------------------------------
' For i = 0 To 9
' Text1.Text = i
' Next i
'----------------------------------------------------------------
' For - for loop
' i - use i as our integer
' 0 - start value = 0
' To - between start and stop value
' 9 - stop value = 9
' Next - go to next step (if i < 9 then end for loop)
'----------------------------------------------------------------
'Description:
' The for loop will loop from the given start walue to the given stop value.
' The amount of loops will then be 10 (first loop i=0).
'-----------------------------------------------------------------------------
|
 |
Visual Basic Source Code |
I hope you found this Visual Basic tutorial useful!
Don't forget to mention Apron Tutorials in your References!
Best Regards
Ronny André Reierstad
|
|
|