Tutorial by Examples

If condition Then code to execute if true ElseIf condition Then code Else code to execute if conditions are both false End If
For I as Integer = 1 To 10 Step 1 code to execute Next Step is optional and Step 1 is the default. Step tells it how to count, so -1 would have it subtract 1 each time and Step 5 would have it add 5 each time thru the loop. In case the loop need to be stopped, then the Exit For statement c...
Another common type of loop in Visual Basic is the DO loop, which would run a piece of code continuously until it is told to stop. On the contrary of some other loops whereby indexes are used to stop the process, in this particular loop, it should be told to stop. A simple example illustrating the ...
Dim number As Integer = 8 Select Case number Case 1 To 5 Debug.WriteLine("Between 1 and 5, inclusive") ' The following is the only Case clause that evaluates to True. Case 6, 7, 8 Debug.WriteLine("Between 6 and 8, inclu...

Page 1 of 1