Flow-control structures: Difference between revisions

Content added Content deleted
(Visual basic)
Line 533: Line 533:
=== Goto ===
=== Goto ===


This skips the line that changes the value of x to 5.
This creates an infinite loop.


Sub foo()
Sub bar2()
Dim x = 0
Dim x = 0
GoTo label
label: x = 5
x = 5
label:
Console.WriteLine(x)
GoTo label
End Sub
End Sub