Repeating a statement until a condition becomes true, Visual Basic Programming

Assignment Help:

You can employ until keyword in two ways to verify a condition in a Do...Loop statement. You can verify the condition before you enter the loop (as illustrated in the following ChkFirstUntil instance), or you can verified it after the loop has run at least once (as illustrated in the ChkLastUntil instance). As long as the condition is False, the loop will be continues.

Sub ChkFirstUntil()

Dim counter, myNum counter = 0

myNum = 20

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

Loop

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

Sub ChkLastUntil()

Dim counter, myNum counter = 0

myNum = 1

Do

myNum = myNum + 1 counter = counter + 1

Loop Until myNum = 10

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


Related Discussions:- Repeating a statement until a condition becomes true

Loop statement from inside the loop, You can exit a Do...Loop using the Exi...

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

Associating images to toolbars - visual basic, Associating Images to Toolba...

Associating Images to Toolbars: 1. Add an Image list to your form from the tool box. 2. Pick the custom property of the image list. 3. Click the images tab. 4. Select

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

Control statements, CONTROL STATEMENTS   The conditional expression us...

CONTROL STATEMENTS   The conditional expression uses a comparison operator that results in true or false value. If the comparison is valid the outcome is true, or else the out

Visual Basic 2010 by Julia Case Bradley and Anita C. Millspa, - I have the ...

- I have the chapter 5 project completed already. This is due tomorrow. Modify the Very Very .Boards project from Chapter 5 to separate the user interface from the business logic.

Accelerators - intrinsic control, Accelerators: The Accelerators are s...

Accelerators: The Accelerators are short cut keys. The Accelerators are formed by placing an ampersand before any of the characters of the Caption. As a product the letter fol

Collection is adding last record, Please help me.. I am loading data from ...

Please help me.. I am loading data from a text file to a class (Item Inventory from Tony Gaddis - Visual Basic - Chapter 12 -programming challange# 7-9) and the last item loaded is

Mechanical project, sir , i need visual basic form design & coding for Reyn...

sir , i need visual basic form design & coding for Reynolds number & type of flow .

Project, I have a project due tomorrow that I am really struggling in. Plea...

I have a project due tomorrow that I am really struggling in. Please help.

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