Loop statement from inside the loop, Visual Basic Programming

Assignment Help:

You can exit a Do...Loop using the Exit Do statement. Since usually you desire to exit only in certain situations, such as to ignore an endless loop, you should employ the Exit Do statement in the True statement block of an If...Then...Else statement. If condition is False, the loop runs as usual. Or else, you probably did not require a loop in the first place.

In the following instance, myNum is assigned a value which creates an endless loop. The If...Then...Else statement verify for this condition, stop the endless repetition.

Sub ExitExample()

Dim counter, myNum counter = 0

myNum = 9

Do Until myNum = 10 myNum = myNum - 1 counter = counter + 1

If myNum < 10 Then Exit Do

Loop

MsgBox "The loop made " & counter & " repetitions." End Sub


Related Discussions:- Loop statement from inside the loop

If - else statement, A variation on the If...Then...Else statement lets you...

A variation on the If...Then...Else statement lets you to choose from various alternatives. By adding up Else If clauses expands the functionality of the If...Then...Else statement

For loop visual basic program, Write Visual Basic programs for the followin...

Write Visual Basic programs for the following: 1.     Write a program that uses a "For Loop" to generate a list of temperature conversions in one degree increments from a given

Help, i need code for assignment problem of operational research in vb

i need code for assignment problem of operational research in vb

Illustration of mdi application using a project, ILLUSTRATION OF MDI APPLIC...

ILLUSTRATION OF MDI APPLICATION USING A PROJECT 1. Choose the MDI option while generating the project by using the Appwizard. 2. Add the WM_LBUTTONDOWN message for the view

Multiple document interface (mdi) windows , MULTIPLE DOCUMENT INTERFACE (MD...

MULTIPLE DOCUMENT INTERFACE (MDI) WINDOWS   The SDI (Single document interface) supports one open window or document at a particular time. Microsoft's notepad and paint are il

Variable naming conventions, For reason of readability & consistency, emplo...

For reason of readability & consistency, employ the following prefixes along with descriptive names for variables in your VBScript code. S ub type Prefi

Create an application for hospital management, 1.   Make project in Visual ...

1.   Make project in Visual Studio 2008. 2.   Controller Class is used for functioning. 3.   Login Form where three people can login like manager, staff and receptionist we c

Kitchen mock, How to pull ordered menu from a cash till to database or disp...

How to pull ordered menu from a cash till to database or display on a computer screen

Using procedure and exception handling, I was looking solution for assignme...

I was looking solution for assignment named Alamo Tour

Need help on macros in visual basic, I have an excel list with a lot's of s...

I have an excel list with a lot's of serial numbers that have been entered by hand from PDFs online (1-5 serial numbers per PDF). Many of the values are duplicates, wrong, or conta

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd