for loop vb code example
Example 1: vb for loop
For variable As [Data Type] = start To end
// Statements to Execute
Next
=================Example=====================
For i As Integer = 0 To 10
Console.WriteLine("Counter: " & i)
Next
Example 2: for loop vb.net
For counter [ As datatype ] = start To end [ Step step ]
[ statements ]
[ Continue For ]
[ statements ]
[ Exit For ]
[ statements ]
Next [ counter ]
Example 3: visual basic for loop
Dim iTotalPrints As Integer
iTotalPrints = 5
For iCount = 1 To iTotalPrints
MsgBox Prompt:=iCount, Title:="Method: Fundamental"
Next
Dim sTextList(4) As String
sTextList(0) = "aaa"
sTextList(1) = "bbb"
sTextList(2) = "ccc"
sTextList(3) = "ddd"
sTextList(4) = "eee"
For Each sSeparateText In sTextList
MsgBox Prompt:=sSeparateText, Title:="Method: Within an Array"
Next