Imports System
Module Program
Sub Main()
Console.WriteLine("Starting infinite While loop. Press Q to quit.")
While True ' infinite loop
Console.Write("Enter something (Q to quit): ")
Dim input As String = Console.ReadLine()
If input.ToUpper() = "Q" Then
Console.WriteLine("Exiting loop...")
Exit While
End If
Console.WriteLine("You typed: " & input)
End While ' infinite loop
Console.WriteLine("Program finished.")
End Sub
End Module
' run:
'
' Starting infinite While loop. Press Q to quit.
' Enter something (Q to quit): a
' You typed: a
' Enter something (Q to quit): b
' You typed: b
' Enter something (Q to quit): a
' You typed: a
' Enter something (Q to quit): q
' Exiting loop...
' Program finished.
'