Answer to Question #44208 in Visual Basic for jj

Question #44208
how to write a Do...Loop while that will loop until the user presses stop?
1
Expert's answer
2014-07-16T05:32:56-0400
Module Module1
''' <summary>
''' Main function
''' </summary>
''' <remarks></remarks>
Sub Main()
'flag for stop loop
Dim _stop As Boolean = True
'Do...Loop while that will loop until the user presses stop
Do While _stop = True
'read key s
Console.Write("Press ""s"" to stop: ")
If (Console.ReadLine().ToUpper() = "S") Then
_stop = False
End If
Loop
'end of loop
Console.Write("End of loop")
'Delay
Console.ReadLine()
End Sub
End Module

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS